Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 333
Add eventType to logs#101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
d0467cb2d8225314b269d8e06b0cd97f315d32d68dbc8dd5aee28ab7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -221,7 +221,10 @@ public static async Task ExecuteWithRetries(Func<Task> retryAction, string sessi | ||
| } | ||
| catch (Exception exception) when (!Utils.IsFatal(exception)) | ||
| { | ||
| TraceHelper.TraceSession(TraceEventType.Warning, sessionId, | ||
| TraceHelper.TraceSession( | ||
| TraceEventType.Warning, | ||
| "ExecuteWithRetry-Failure", | ||
| sessionId, | ||
| $"Error attempting operation {operation}. Attempt count: {numberOfAttempts - retryCount}. Exception: {exception.Message}\n\t{exception.StackTrace}"); | ||
| lastException = exception; | ||
| } | ||
| @@ -231,8 +234,8 @@ public static async Task ExecuteWithRetries(Func<Task> retryAction, string sessi | ||
| if (retryCount <= 0 && lastException != null) | ||
| { | ||
| TraceHelper.Trace(TraceEventType.Error, "Exhausted all retries for operation " + operation); | ||
| throw TraceHelper.TraceExceptionSession(TraceEventType.Error, sessionId, lastException); | ||
| TraceHelper.Trace(TraceEventType.Error, "ExecuteWithRetry-RetriesExhausted", "Exhausted all retries for operation " + operation); | ||
| throw TraceHelper.TraceExceptionSession(TraceEventType.Error, "ExecuteWithRetryRetriesExhausted", sessionId, lastException); | ||
| } | ||
| } | ||
| @@ -254,7 +257,10 @@ public static async Task<T> ExecuteWithRetries<T>(Func<Task<T>> retryAction, str | ||
| } | ||
| catch (Exception exception) when (!Utils.IsFatal(exception)) | ||
| { | ||
| TraceHelper.TraceSession(TraceEventType.Warning, sessionId, | ||
| TraceHelper.TraceSession( | ||
| TraceEventType.Warning, | ||
| $"ExecuteWithRetry<{typeof(T)}>-Failure", | ||
| sessionId, | ||
| $"Error attempting operation {operation}. Attempt count: {numberOfAttempts - retryCount}. Exception: {exception.Message}\n\t{exception.StackTrace}"); | ||
| lastException = exception; | ||
| } | ||
| @@ -264,8 +270,9 @@ public static async Task<T> ExecuteWithRetries<T>(Func<Task<T>> retryAction, str | ||
| if (retryCount <= 0 && lastException != null) | ||
| { | ||
| TraceHelper.Trace(TraceEventType.Error, "Exhausted all retries for operation " + operation); | ||
| throw TraceHelper.TraceExceptionSession(TraceEventType.Error, sessionId, lastException); | ||
| var eventType = $"ExecuteWithRetry<{typeof(T)}>-Failure"; | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Same comment as above | ||
| TraceHelper.Trace(TraceEventType.Error, eventType, "Exhausted all retries for operation " + operation); | ||
| throw TraceHelper.TraceExceptionSession(TraceEventType.Error, eventType, sessionId, lastException); | ||
| } | ||
| return retVal; | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be 'nameof' instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeof works in this case as its the signature of the method call rather than a case like a param where nameof would be used