mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-01-14 14:41:11 -05:00
Co-authored-by: Frank Elsinga <frank@elsinga.de> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
22 lines
563 B
JavaScript
22 lines
563 B
JavaScript
/**
|
|
* Error whose message is a translation key.
|
|
* @augments Error
|
|
*/
|
|
class TranslatableError extends Error {
|
|
/**
|
|
* Indicates that the error message is a translation key.
|
|
*/
|
|
msgi18n = true;
|
|
|
|
/**
|
|
* Create a TranslatableError.
|
|
* @param {string} key - Translation key present in src/lang/en.json
|
|
* @param {object} meta Arbitrary metadata
|
|
*/
|
|
constructor(key, meta = {}) {
|
|
super(key);
|
|
this.meta = meta;
|
|
Error.captureStackTrace(this, this.constructor);
|
|
}
|
|
}
|
|
module.exports = TranslatableError;
|