Skip to content
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

Fixing error title so it reflects that of the exception being thrown #532

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 9 additions & 10 deletions Rollbar.NetCore.AspNet/RollbarMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ public async Task Invoke(HttpContext context)
}

await this._nextRequestProcessor(context);


}
catch (System.Exception ex)
{
Expand Down Expand Up @@ -157,15 +155,16 @@ public async Task Invoke(HttpContext context)
throw;
}
}
else
{
IRollbarPackage rollbarPackage = new ExceptionPackage(ex, $"{nameof(RollbarMiddleware)} processed uncaught exception.");
rollbarPackage = new HttpRequestPackageDecorator(rollbarPackage, context.Request, true);
rollbarPackage = new HttpResponsePackageDecorator(rollbarPackage, context.Response, true);
RollbarLocator.RollbarInstance.Critical(rollbarPackage);
}

throw new RollbarMiddlewareException(ex);
var title = !string.IsNullOrWhiteSpace(ex.Message)
? ex.Message
: $"{nameof(RollbarMiddleware)} processed uncaught exception.";
IRollbarPackage rollbarPackage = new ExceptionPackage(ex, title);
rollbarPackage = new HttpRequestPackageDecorator(rollbarPackage, context.Request, true);
rollbarPackage = new HttpResponsePackageDecorator(rollbarPackage, context.Response, true);
RollbarLocator.RollbarInstance.Critical(rollbarPackage);

throw;
}
finally
{
Expand Down
60 changes: 0 additions & 60 deletions Rollbar.NetCore.AspNet/RollbarMiddlewareException.cs

This file was deleted.