Skip to content

Commit

Permalink
chore(back): notFound object error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuildy committed Nov 5, 2022
1 parent 7f5f778 commit 3bc053d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion back/src/filters/catch-all.filter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NoSuchBucket } from '@aws-sdk/client-s3';
import { NoSuchBucket, NotFound } from '@aws-sdk/client-s3';
import {
ExceptionFilter,
Catch,
Expand Down Expand Up @@ -39,6 +39,13 @@ export class AllExceptionsFilter implements ExceptionFilter {
trace: exception instanceof Error ? exception.stack : '',
path,
});
} else if (exception instanceof NotFound) {
responseBody = this.formatMessage({
statusCode: 500,
reason: `object not found`,
trace: exception instanceof Error ? exception.stack : '',
path,
});
} else {
const httpStatus =
exception instanceof HttpException
Expand Down

0 comments on commit 3bc053d

Please sign in to comment.