@nocobase/plugin-error-handler 1.7.0-beta.3 → 1.7.0-beta.31
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/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-error-handler",["@nocobase/client"],t):"object"==typeof exports?exports["@nocobase/plugin-error-handler"]=t(require("@nocobase/client")):e["@nocobase/plugin-error-handler"]=t(e["@nocobase/client"])}(self,function(e){return function(){"use strict";var t={772:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var u=n[e]={exports:{}};return t[e](u,u.exports,r),u.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};r.r(o);var
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-error-handler",["@nocobase/client"],t):"object"==typeof exports?exports["@nocobase/plugin-error-handler"]=t(require("@nocobase/client")):e["@nocobase/plugin-error-handler"]=t(e["@nocobase/client"])}(self,function(e){return function(){"use strict";var t={772:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var u=n[e]={exports:{}};return t[e](u,u.exports,r),u.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return!function(){r.r(o);var e=r(772);function t(e,t,n,r,o,u,i){try{var c=e[u](i),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function n(e,t,r){return(n=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&i(o,n.prototype),o}).apply(null,arguments)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return n(e,arguments,u(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i(r,e)})(e)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}o.default=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=u(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(e,t||[],u(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&i(r,e),n=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(u){return function(c){var a=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return[2]})},function(){var n=this,r=arguments;return new Promise(function(o,u){var i=e.apply(n,r);function c(e){t(i,o,u,c,a,"next",e)}function a(e){t(i,o,u,c,a,"throw",e)}c(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,n),r}(c(e.Plugin))}(),o}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.7.0-beta.
|
|
11
|
+
"@nocobase/client": "1.7.0-beta.31",
|
|
12
12
|
"@formily/json-schema": "2.3.0",
|
|
13
|
-
"@nocobase/database": "1.7.0-beta.
|
|
14
|
-
"@nocobase/server": "1.7.0-beta.
|
|
13
|
+
"@nocobase/database": "1.7.0-beta.31",
|
|
14
|
+
"@nocobase/server": "1.7.0-beta.31",
|
|
15
15
|
"lodash": "4.17.21"
|
|
16
16
|
};
|
package/dist/locale/it-IT.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"unique violation": "{{field}} già esiste",
|
|
3
3
|
"notNull violation": "{{field}} non può essere vuoto",
|
|
4
|
-
"Validation error": "{{field}} errore di convalida"
|
|
5
|
-
"notNull Violation": "{{field}} non può essere vuoto"
|
|
4
|
+
"Validation error": "{{field}} errore di convalida"
|
|
6
5
|
}
|
package/dist/locale/nl-NL.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"unique violation": "{{field}}
|
|
3
|
-
"notNull violation": "{{field}}
|
|
4
|
-
"Validation error": "{{field}}
|
|
5
|
-
"notNull Violation": "{{field}} cannot be null"
|
|
2
|
+
"unique violation": "{{field}} bestaat al",
|
|
3
|
+
"notNull violation": "{{field}} mag niet leeg zijn",
|
|
4
|
+
"Validation error": "{{field}} validatiefout"
|
|
6
5
|
}
|
|
@@ -43,13 +43,15 @@ class ErrorHandler {
|
|
|
43
43
|
if (err.cause) {
|
|
44
44
|
message += `: ${err.cause.message}`;
|
|
45
45
|
}
|
|
46
|
+
const errorData = {
|
|
47
|
+
message,
|
|
48
|
+
code: err.code
|
|
49
|
+
};
|
|
50
|
+
if (err == null ? void 0 : err.title) {
|
|
51
|
+
errorData.title = err.title;
|
|
52
|
+
}
|
|
46
53
|
ctx.body = {
|
|
47
|
-
errors: [
|
|
48
|
-
{
|
|
49
|
-
message,
|
|
50
|
-
code: err.code
|
|
51
|
-
}
|
|
52
|
-
]
|
|
54
|
+
errors: [errorData]
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
renderError(err, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"unique violation": "{{field}}
|
|
3
|
-
"notNull violation": "notNull
|
|
4
|
-
"Validation error": "{{field}}
|
|
5
|
-
"notNull Violation": "{{field}}
|
|
2
|
+
"unique violation": "{{field}} moet uniek zijn",
|
|
3
|
+
"notNull violation": "notNull schending",
|
|
4
|
+
"Validation error": "{{field}} validatiefout",
|
|
5
|
+
"notNull Violation": "{{field}} mag niet leeg zijn"
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "错误处理器",
|
|
5
5
|
"description": "Handling application errors and exceptions.",
|
|
6
6
|
"description.zh-CN": "处理应用程序中的错误和异常。",
|
|
7
|
-
"version": "1.7.0-beta.
|
|
7
|
+
"version": "1.7.0-beta.31",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"devDependencies": {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
24
24
|
"directory": "packages/plugin-error-handler"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "84bf8bcfeeaf3a05086e24cef00507ca209ac3c5"
|
|
27
27
|
}
|