Manual Reference Source Test
import ApiError from 'pop-api/src/helpers/ApiError.js'
public class | source

ApiError

Extends:

Error → ApiError

Error class for the Api.

Test:

Constructor Summary

Public Constructor
public

constructor(options: Object)

Create a new ApiError object.

Member Summary

Public Members
public

Whenever the error is operational or not

public

Whenever the error is public or not.

public

The message of the error

public

The name of the error

public

The status of the error

Public Constructors

public constructor(options: Object) source

Create a new ApiError object.

Params:

NameTypeAttributeDescription
options Object
  • nullable: false

The options for the ApiError.

options.message string
  • nullable: false

The message of the error.

options.status string
  • default: 500
  • nullable: false

The status code of the error.

options.isPublic boolean
  • default: false
  • nullable: false

Whenever the error is public or not.

Test:

Public Members

public isOperational: boolean source

Whenever the error is operational or not

public isPublic: boolean source

Whenever the error is public or not.

public message: string source

The message of the error

public name: string source

The name of the error

public status: string source

The status of the error