Explorar o código

add optional i18nArg to ErrorV3

Yohei-Shiina %!s(int64=3) %!d(string=hai) anos
pai
achega
ccacbb3e01
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      packages/app/src/server/models/vo/error-apiv3.js

+ 5 - 1
packages/app/src/server/models/vo/error-apiv3.js

@@ -15,15 +15,19 @@
  *            example: 'someapi-error-with-something'
  *          stack:
  *            type: object
+ *          i18nArg:
+ *            type: object
+ *            example: { name: 'Josh', age: 20 }
  */
 
 class ErrorV3 extends Error {
 
-  constructor(message = '', code = '', stack = undefined) {
+  constructor(message = '', code = '', stack = undefined, i18nArg = undefined) {
     super(); // do not provide message to the super constructor
     this.message = message;
     this.code = code;
     this.stack = stack;
+    this.i18nArg = i18nArg;
   }
 
 }