Pārlūkot izejas kodu

add optional i18nArg to ErrorV3

Yohei-Shiina 3 gadi atpakaļ
vecāks
revīzija
ccacbb3e01
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  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;
   }
 
 }