🚨 Announcing Vendure v2 Beta

I18nError

I18nError

Package: @vendure/core File: i18n-error.ts

All errors thrown in the Vendure server must use or extend this error class. This allows the error message to be translated before being served to the client.

The error messages should be provided in the form of a string key which corresponds to a key defined in the i18n/messages/<languageCode>.json files.

Note that this class should not be directly used in code, but should be extended by a more specific Error class.

Signature

class I18nError extends ApolloError {
  constructor(message: string, variables: { [key: string]: string | number } = {}, code?: string, logLevel: LogLevel = LogLevel.Warn)
}

Extends

  • ApolloError

Members

constructor

protected method
type:
(message: string, variables: { [key: string]: string | number } = {}, code?: string, logLevel: LogLevel = LogLevel.Warn) => I18nError