Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HttpException

Hierarchy

Index

Constructors

constructor

  • new HttpException(response: string | any, status: number): HttpException
  • Base Nest application exception, which is handled by the default Exceptions Handler. If you throw an exception from your HTTP route handlers, Nest will map them to the appropriate HTTP response and send to the client.

    When response is an object:

    • object will be stringified and returned to the user as a JSON response,

    When response is a string:

    • Nest will create a response with two properties:
      message: response,
      statusCode: X

    Parameters

    • response: string | any
    • status: number

    Returns HttpException

Properties

message

message: any

name

name: string

Private response

response: string | any

Optional stack

stack: string

Private status

status: number

Static Error

Error: ErrorConstructor

Methods

getResponse

  • getResponse(): string | any

getStatus

  • getStatus(): number

Generated using TypeDoc