File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1- import { MyError } from './error' ;
1+ import { MyError , HttpError } from './error' ;
22import logger from './logger' ;
33
44/**
55 * Log error to destination then exit the process if programmer error
66 * @param err error to be handled
77 */
8- const handle = ( err : MyError ) : void => {
8+ const handle = ( err : MyError | HttpError ) : void => {
99 // E.g. log to sentry
1010 // E.g. log to console
1111 logger . error ( err ) ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const handleErrors = (
3939 errorHandler . handle ( err ) ;
4040
4141 try {
42- // check if status code exists
42+ // check if status code exists, error thrown if doesn't
4343 getStatusText ( ( err as HttpError ) . code ) ;
4444
4545 res . status ( ( err as HttpError ) . code ) . send ( err ) ;
You can’t perform that action at this time.
0 commit comments