Skip to content

Error handling doesn't work #661

@t3hk0d3

Description

@t3hk0d3

Application crashes after calling an HTTP endpoint without expected JSON input.

error: Uncaught (in promise) BadRequestError: Unexpected end of JSON input
  return new errors[Status[status] as ErrorStatusKeys](message, options);
         ^
    at createHttpError (https://jsr.io/@oak/commons/0.11.0/http_errors.ts:211:10)
    at Body.json (https://deno.land/x/oak@v16.1.0/body.ts:152:15)
    at eventLoopTick (ext:core/01_core.js:168:7)

Wrapping it into another middleware doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    unactionableThere is no logical action to take with this issueworking as designedThis is working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions