adapt-authoring-lang 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/LangModule.js +1 -1
- package/package.json +1 -1
package/lib/LangModule.js
CHANGED
|
@@ -183,7 +183,7 @@ class LangModule extends AbstractModule {
|
|
|
183
183
|
* @returns The translated error (if passed error is not an instance of AdaptError, the original value will be returned)
|
|
184
184
|
*/
|
|
185
185
|
translateError (lang, error) {
|
|
186
|
-
return error
|
|
186
|
+
return error?.constructor.name.endsWith('Error') ? this.translate(lang, `error.${error.code}`, error.data ?? error) : error
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|