Skip to content

Commit

Permalink
Fix error handling in GetActivityController and import NotFoundError …
Browse files Browse the repository at this point in the history
…from RepoError
  • Loading branch information
LucaPinheiro committed May 2, 2024
1 parent d140f94 commit b16f9e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/get_activity/app/get_activity_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
MissingParameter,
UserNotAuthenticated,
} from "../../../core/helpers/errors/ModuleError";
import { NotFoundError } from "../../../core/helpers/errors/RepoError";
import {
BadRequest,
HttpRequest,
Expand Down Expand Up @@ -48,6 +49,9 @@ export class GetActivityController {
if (error instanceof MissingParameter) {
return new NotFound(error.message);
}
if (error instanceof NotFoundError) {
return new NotFound(error.message);
}
return new InternalServerError(error.message);
}
}
Expand Down

0 comments on commit b16f9e3

Please sign in to comment.