Skip to content

Commit

Permalink
ignore 404s in rollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Aug 29, 2023
1 parent d3df239 commit 344cb72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/utils/http-exception.filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import * as Rollbar from 'rollbar';
export class HttpExceptionFilter implements ExceptionFilter {
private rollbar: Rollbar;

private readonly ignoredStatus = [404];

constructor(@Inject(ROLLBAR_CONFIG) private rollbarConfig) {
this.rollbar = new Rollbar(this.rollbarConfig);
}
Expand All @@ -24,7 +26,7 @@ export class HttpExceptionFilter implements ExceptionFilter {
const request = ctx.getRequest<Request>();
const status = exception.getStatus();

if (this.rollbar) {
if (this.rollbar && !this.ignoredStatus.includes(status)) {
this.rollbar.error(exception);
}

Expand Down

0 comments on commit 344cb72

Please sign in to comment.