UNPKG

i18n-llm-translate

Version:

Automatically translates namespace-based JSON translation files across multiple languages from any source language

22 lines (21 loc) 806 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BreakSilentError = void 0; exports.isBreakSilentError = isBreakSilentError; /** * Thrown when the engine stops cleanly without dumping the wrapped API error to the console. * Use {@link isBreakSilentError} to detect. Pass `verboseEngineErrors: true` in translate options * to log {@link originalError} from translate()'s catch handler. */ class BreakSilentError extends Error { constructor(message, originalError) { super(message); this.name = 'BreakSilentError'; this.originalError = originalError; Object.setPrototypeOf(this, new.target.prototype); } } exports.BreakSilentError = BreakSilentError; function isBreakSilentError(e) { return e instanceof BreakSilentError; }