react-i18next
Version:
Internationalization for react done right. Using the i18next i18n ecosystem.
25 lines (20 loc) • 734 B
JavaScript
/**
* Error thrown during translation parsing
*/
export class TranslationParserError extends Error {
/**
* @param {string} message - Error message
* @param {number} [position] - Position in the translation string where the error occurred
* @param {string} [translationString] - The full translation string being parsed
*/
constructor(message, position, translationString) {
super(message);
this.name = 'TranslationParserError';
this.position = position;
this.translationString = translationString;
// Maintains proper stack trace for where our error was thrown (only available on V8)
if (Error.captureStackTrace) {
Error.captureStackTrace(this, TranslationParserError);
}
}
}