Skip to content

Commit 9c3a5a3

Browse files
Cleanup error handling in GetTableChanges (#544)
1 parent 372b71f commit 9c3a5a3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/TriggerBinding/SqlTableChangeMonitor.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,20 +365,18 @@ private async Task GetTableChangesAsync(SqlConnection connection, CancellationTo
365365

366366
TelemetryInstance.TrackEvent(TelemetryEventName.GetChangesEnd, this._telemetryProps, measures);
367367
}
368-
catch (Exception ex)
368+
catch (Exception)
369369
{
370-
this._logger.LogError($"Failed to query list of changes for table '{this._userTable.FullName}' due to exception: {ex.GetType()}. Exception message: {ex.Message}");
371-
TelemetryInstance.TrackException(TelemetryErrorName.GetChanges, ex, this._telemetryProps);
372-
373370
try
374371
{
375372
transaction.Rollback();
376373
}
377-
catch (Exception ex2)
374+
catch (Exception ex)
378375
{
379-
this._logger.LogError($"Failed to rollback transaction due to exception: {ex2.GetType()}. Exception message: {ex2.Message}");
380-
TelemetryInstance.TrackException(TelemetryErrorName.GetChangesRollback, ex2, this._telemetryProps);
376+
this._logger.LogError($"Failed to rollback transaction due to exception: {ex.GetType()}. Exception message: {ex.Message}");
377+
TelemetryInstance.TrackException(TelemetryErrorName.GetChangesRollback, ex, this._telemetryProps);
381378
}
379+
throw;
382380
}
383381
}
384382
}

0 commit comments

Comments
 (0)