ApiError

server/api/utils/errors~ ApiError

new ApiError()

Source:
Properties:
Name Type Description
name string

The type of error.

status number

The HTTP status code to respond with when this error occurs.

code string

A code identifying the error (e.g. category.whatWentWrong).

message string

A description of the problem.

An API error.

When thrown from an API route or middleware, an error of this type will automatically be serialized as JSON and the HTTP response will have the correct status code.

Extends

  • Error