Skip to content

throw new NotFoundError, cant override message. #440

@MarkMatute

Description

@MarkMatute

Having this to intentionally throw error,

@Get('/:id') async getUser(@Param('id') id: number) { throw new NotFoundError("Nor Found"); }

Shows this result, message haven't override, instead of this long message, just want to display not found

Error at NotFoundError.HttpError [as constructor] (/Users/markmatute/Desktop/simple-ts/node_modules/routing-controllers/http-error/HttpError.js:27:23) at new NotFoundError (/Users/markmatute/Desktop/simple-ts/node_modules/routing-controllers/http-error/NotFoundError.js:20:28) at UserController.<anonymous> (/Users/markmatute/Desktop/simple-ts/dist/controllers/User.controller.js:44:19) at Generator.next (<anonymous>) at /Users/markmatute/Desktop/simple-ts/dist/controllers/User.controller.js:19:71 at new Promise (<anonymous>) at __awaiter (/Users/markmatute/Desktop/simple-ts/dist/controllers/User.controller.js:15:12) at UserController.getUser (/Users/markmatute/Desktop/simple-ts/dist/controllers/User.controller.js:41:16) at ActionMetadata.callMethod (/Users/markmatute/Desktop/simple-ts/node_modules/routing-controllers/metadata/ActionMetadata.js:108:48) at /Users/markmatute/Desktop/simple-ts/node_modules/routing-controllers/RoutingControllers.js:92:140

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions