Explorar el Código

add optional i18nArg to ErrorV3

Yohei-Shiina hace 3 años
padre
commit
ccacbb3e01
Se han modificado 1 ficheros con 5 adiciones y 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;
   }
 
 }