Skip to main content

I18nError

I18nError

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 GraphQLError {
constructor(message: string, variables: { [key: string]: string | number } = {}, code?: string, logLevel: LogLevel = LogLevel.Warn)
}
  • Extends: GraphQLError

constructor

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