Skip to main content

Error Types

InternalServerError

This error should be thrown when some unexpected and exceptional case is encountered.

Signature
class InternalServerError extends I18nError {
constructor(message: string, variables: { [key: string]: string | number } = {})
}

constructor

method
(message: string, variables: { [key: string]: string | number } = {}) => InternalServerError

UserInputError

This error should be thrown when user input is not as expected.

Signature
class UserInputError extends I18nError {
constructor(message: string, variables: { [key: string]: string | number } = {})
}

constructor

method
(message: string, variables: { [key: string]: string | number } = {}) => UserInputError

IllegalOperationError

This error should be thrown when an operation is attempted which is not allowed.

Signature
class IllegalOperationError extends I18nError {
constructor(message: string, variables: { [key: string]: string | number } = {})
}

constructor

method
(message: string, variables: { [key: string]: string | number } = {}) => IllegalOperationError

UnauthorizedError

This error should be thrown when the user's authentication credentials do not match.

Signature
class UnauthorizedError extends I18nError {
constructor()
}

constructor

method
() => UnauthorizedError

ForbiddenError

This error should be thrown when a user attempts to access a resource which is outside of his or her privileges.

Signature
class ForbiddenError extends I18nError {
constructor(logLevel: LogLevel = LogLevel.Warn)
}

constructor

method
(logLevel: LogLevel = LogLevel.Warn) => ForbiddenError

ChannelNotFoundError

This error should be thrown when a Channel cannot be found based on the provided channel token.

Signature
class ChannelNotFoundError extends I18nError {
constructor(token: string)
}

constructor

method
(token: string) => ChannelNotFoundError

EntityNotFoundError

This error should be thrown when an entity cannot be found in the database, i.e. no entity of the given entityName (Product, User etc.) exists with the provided id.

Signature
class EntityNotFoundError extends I18nError {
constructor(entityName: keyof typeof coreEntitiesMap | string, id: ID)
}

constructor

method
(entityName: keyof typeof coreEntitiesMap | string, id: ID) => EntityNotFoundError