Skip to content

Commit

Permalink
fix spelling in error.controller file and test
Browse files Browse the repository at this point in the history
  • Loading branch information
harley-harris committed Jul 9, 2024
1 parent f7527cf commit 46576a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controller/error.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const errorNotFound = (_req: Request, res: Response) => {

export const errorHandler = (err: Error, _req: Request, res: Response, _next: NextFunction) => {
const statusCode = !res.statusCode || res.statusCode === 200 ? 500 : res.statusCode;
const errorMessage = err.message || 'An error has occured. Re-routing to the error screen';
const errorMessage = err.message || 'An error has occurred. Re-routing to the error screen';

log.error(`Error ${statusCode}: ${errorMessage}`);
res.status(statusCode).render(config.ERROR_PAGE);
Expand Down
3 changes: 2 additions & 1 deletion test/unit/controller/error.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ describe('Error controller tests', () => {
test('should log alternate error message', () => {
const res = mockResponse();
MOCK_ERROR.message = '';
const errorLogMessage = 'Error 500: An error has occured. Re-routing to the error screen';
const errorLogMessage =
'Error 500: An error has occurred. Re-routing to the error screen';

errorHandler(MOCK_ERROR, req, res, next);

Expand Down

0 comments on commit 46576a2

Please sign in to comment.