chanlito / nestjs-extensions

[WIP] A bunch of useful and opinionated filters, modules, pipes... to use with Nest framework. 😻
42 stars 0 forks source link

ApplicationExceptionFilter return 500 on nest version 4.6.5 #3

Closed Dominic-Preap closed 6 years ago

Dominic-Preap commented 6 years ago

On version 4.6.5 updates say:

In your code base by checking instanceof Error will make every exception to status 500

if (err instanceof Error) {
      console.error(errTitle, err);
      const statusCode = HttpStatus.INTERNAL_SERVER_ERROR;
      res.status(statusCode).json({
        statusCode,
        message: 'Internal Server Error'
      });
    }
chanlito commented 6 years ago

fixed