Use this instead of the default one to have the new properties specific for DRF and sentry.

Hierarchy

  • HttpErrorResponse
    • HttpErrorResponse

Constructors

  • Parameters

    • init: {
          error?: any;
          headers?: HttpHeaders;
          status?: number;
          statusText?: string;
          url?: string;
      }
      • Optionalerror?: any
      • Optionalheaders?: HttpHeaders
      • Optionalstatus?: number
      • OptionalstatusText?: string
      • Optionalurl?: string

    Returns HttpErrorResponse

Properties

error: any

Types for DRF error response.

headers: HttpHeaders

All response headers.

message: string
name: "HttpErrorResponse" = "HttpErrorResponse"
ok: false = false

Errors are never okay, even when the status code is in the 2xx success range.

preventSentryReport: boolean = false

Set this to true and use it in your sentry to prevent report.

status: number

Response status code.

statusText: string

Textual description of response status code, defaults to OK.

Do not depend on this.

type: ResponseHeader | Response

Type of the response, narrowed to either the full response or the header.

url: null | string

URL of the resource retrieved, or null if not available.