oak-domain 5.1.17 → 5.1.18
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/types/Exception.d.ts +21 -21
- package/lib/types/Exception.js +65 -65
- package/package.json +1 -1
package/lib/types/Exception.d.ts
CHANGED
|
@@ -3,15 +3,15 @@ import { EntityDict, OpRecord } from "./Entity";
|
|
|
3
3
|
import { EntityDict as BaseEntityDict } from '../base-app-domain';
|
|
4
4
|
export declare class OakException<ED extends EntityDict & BaseEntityDict> extends Error {
|
|
5
5
|
opRecords: OpRecord<ED>[];
|
|
6
|
-
|
|
6
|
+
_module?: string;
|
|
7
7
|
params?: Record<string, any>;
|
|
8
|
-
constructor(message?: string,
|
|
8
|
+
constructor(message?: string, _module?: string, params?: Record<string, any>);
|
|
9
9
|
addData<T extends keyof ED>(entity: T, rows: Partial<ED[T]['Schema']>[], schema: StorageSchema<ED>): void;
|
|
10
10
|
setOpRecords(opRecords: OpRecord<ED>[]): void;
|
|
11
11
|
getSerialData(): {
|
|
12
12
|
name: string;
|
|
13
13
|
message: string;
|
|
14
|
-
|
|
14
|
+
_module: string | undefined;
|
|
15
15
|
opRecords: OpRecord<ED>[];
|
|
16
16
|
tag1: string | undefined;
|
|
17
17
|
tag2: boolean | undefined;
|
|
@@ -34,7 +34,7 @@ export declare class OakDataException<ED extends EntityDict & BaseEntityDict> ex
|
|
|
34
34
|
export declare class OakNoRelationDefException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakDataException<ED> {
|
|
35
35
|
entity: T;
|
|
36
36
|
actions: ED[T]['Action'][];
|
|
37
|
-
constructor(entity: T, actions: ED[T]['Action'][], msg?: string,
|
|
37
|
+
constructor(entity: T, actions: ED[T]['Action'][], msg?: string, _module?: string, params?: Record<string, any>);
|
|
38
38
|
toString(): string;
|
|
39
39
|
}
|
|
40
40
|
export declare class OakOperExistedException<ED extends EntityDict & BaseEntityDict> extends OakDataException<ED> {
|
|
@@ -44,7 +44,7 @@ export declare class OakRowUnexistedException<ED extends EntityDict & BaseEntity
|
|
|
44
44
|
constructor(rows: Array<{
|
|
45
45
|
entity: any;
|
|
46
46
|
selection: any;
|
|
47
|
-
}>, msg?: string,
|
|
47
|
+
}>, msg?: string, _module?: string, params?: Record<string, any>);
|
|
48
48
|
toString(): string;
|
|
49
49
|
getRows(): {
|
|
50
50
|
entity: any;
|
|
@@ -64,12 +64,12 @@ export declare class OakUniqueViolationException<ED extends EntityDict & BaseEnt
|
|
|
64
64
|
constructor(rows: Array<{
|
|
65
65
|
id?: string;
|
|
66
66
|
attrs: string[];
|
|
67
|
-
}>, message?: string,
|
|
67
|
+
}>, message?: string, _module?: string, params?: Record<string, any>);
|
|
68
68
|
}
|
|
69
69
|
export declare class OakImportDataParseException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
|
|
70
70
|
line: number;
|
|
71
71
|
header?: string;
|
|
72
|
-
constructor(message: string, line: number, header?: string,
|
|
72
|
+
constructor(message: string, line: number, header?: string, _module?: string, params?: Record<string, any>);
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* 网络中断异常
|
|
@@ -81,7 +81,7 @@ export declare class OakServerProxyException<ED extends EntityDict & BaseEntityD
|
|
|
81
81
|
export declare class OakClockDriftException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
|
|
82
82
|
}
|
|
83
83
|
export declare class OakSignatureVerificationException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
|
|
84
|
-
constructor(message?: string,
|
|
84
|
+
constructor(message?: string, _module?: string, params?: Record<string, any>);
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* 数据不一致异常,系统认为现有的数据不允许相应的动作时抛此异常
|
|
@@ -96,7 +96,7 @@ export declare class OakRowInconsistencyException<ED extends EntityDict & BaseEn
|
|
|
96
96
|
export declare class OakInputIllegalException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
|
|
97
97
|
private attributes;
|
|
98
98
|
private entity;
|
|
99
|
-
constructor(entity: keyof ED, attributes: string[], message?: string,
|
|
99
|
+
constructor(entity: keyof ED, attributes: string[], message?: string, _module?: string, params?: Record<string, any>);
|
|
100
100
|
getEntity(): keyof ED;
|
|
101
101
|
getAttributes(): string[];
|
|
102
102
|
addAttributesPrefix(prefix: string): void;
|
|
@@ -106,13 +106,13 @@ export declare class OakInputIllegalException<ED extends EntityDict & BaseEntity
|
|
|
106
106
|
* 属性为空时抛的异常
|
|
107
107
|
*/
|
|
108
108
|
export declare class OakAttrNotNullException<ED extends EntityDict & BaseEntityDict> extends OakInputIllegalException<ED> {
|
|
109
|
-
constructor(entity: keyof ED, attributes: string[], message?: string,
|
|
109
|
+
constructor(entity: keyof ED, attributes: string[], message?: string, _module?: string, params?: Record<string, any>);
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* 属性不允许更新抛的异常,前端可以用这个异常来处理update时对应属性的露出
|
|
113
113
|
*/
|
|
114
114
|
export declare class OakAttrCantUpdateException<ED extends EntityDict & BaseEntityDict> extends OakInputIllegalException<ED> {
|
|
115
|
-
constructor(entity: keyof ED, attributes: string[], message?: string,
|
|
115
|
+
constructor(entity: keyof ED, attributes: string[], message?: string, _module?: string, params?: Record<string, any>);
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
118
|
* 用户权限不够时抛的异常
|
|
@@ -120,7 +120,7 @@ export declare class OakAttrCantUpdateException<ED extends EntityDict & BaseEnti
|
|
|
120
120
|
export declare class OakOperationUnpermittedException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
|
|
121
121
|
private entity;
|
|
122
122
|
private operation;
|
|
123
|
-
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string,
|
|
123
|
+
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string, _module?: string, params?: Record<string, any>);
|
|
124
124
|
toString(): string;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
@@ -129,20 +129,20 @@ export declare class OakOperationUnpermittedException<ED extends EntityDict & Ba
|
|
|
129
129
|
export declare class OakDataInvisibleException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
|
|
130
130
|
private entity;
|
|
131
131
|
private operation;
|
|
132
|
-
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string,
|
|
132
|
+
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string, _module?: string, params?: Record<string, any>);
|
|
133
133
|
toString(): string;
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
136
|
* 用户未登录抛的异常
|
|
137
137
|
*/
|
|
138
138
|
export declare class OakUnloggedInException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
|
|
139
|
-
constructor(message?: string,
|
|
139
|
+
constructor(message?: string, _module?: string, params?: Record<string, any>);
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
* 行数据被锁抛的异常
|
|
143
143
|
*/
|
|
144
144
|
export declare class OakRowLockedException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
|
|
145
|
-
constructor(message?: string,
|
|
145
|
+
constructor(message?: string, _module?: string, params?: Record<string, any>);
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* 要插入行时,发现已经有相同的行数据
|
|
@@ -150,7 +150,7 @@ export declare class OakRowLockedException<ED extends EntityDict & BaseEntityDic
|
|
|
150
150
|
export declare class OakCongruentRowExists<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
|
|
151
151
|
private data;
|
|
152
152
|
private entity;
|
|
153
|
-
constructor(entity: T, data: ED[T]['OpSchema'], message?: string,
|
|
153
|
+
constructor(entity: T, data: ED[T]['OpSchema'], message?: string, _module?: string, params?: Record<string, any>);
|
|
154
154
|
getData(): ED[T]["OpSchema"];
|
|
155
155
|
getEntity(): T;
|
|
156
156
|
toString(): string;
|
|
@@ -159,7 +159,7 @@ export declare class OakCongruentRowExists<ED extends EntityDict & BaseEntityDic
|
|
|
159
159
|
* 死锁抛的异常
|
|
160
160
|
*/
|
|
161
161
|
export declare class OakDeadlock<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
|
|
162
|
-
constructor(message?: string,
|
|
162
|
+
constructor(message?: string, _module?: string, params?: Record<string, any>);
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* 前置条件不满足抛的异常
|
|
@@ -167,7 +167,7 @@ export declare class OakDeadlock<ED extends EntityDict & BaseEntityDict> extends
|
|
|
167
167
|
export declare class OakPreConditionUnsetException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
|
|
168
168
|
entity?: keyof ED;
|
|
169
169
|
code?: string;
|
|
170
|
-
constructor(message?: string, entity?: keyof ED, code?: string,
|
|
170
|
+
constructor(message?: string, entity?: keyof ED, code?: string, _module?: string, params?: Record<string, any>);
|
|
171
171
|
toString(): string;
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
@@ -177,19 +177,19 @@ export declare class OakExternalException<ED extends EntityDict & BaseEntityDict
|
|
|
177
177
|
code?: string;
|
|
178
178
|
source: string;
|
|
179
179
|
data?: any;
|
|
180
|
-
constructor(source: string, code?: string, message?: string, data?: any,
|
|
180
|
+
constructor(source: string, code?: string, message?: string, data?: any, _module?: string, params?: Record<string, any>);
|
|
181
181
|
toString(): string;
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
184
|
* socket连接异常
|
|
185
185
|
*/
|
|
186
186
|
export declare class OakSocketConnectException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
|
|
187
|
-
constructor(message?: string,
|
|
187
|
+
constructor(message?: string, _module?: string, params?: Record<string, any>);
|
|
188
188
|
}
|
|
189
189
|
export declare function makeException<ED extends EntityDict & BaseEntityDict>(data: {
|
|
190
190
|
name: string;
|
|
191
191
|
message?: string;
|
|
192
|
-
|
|
192
|
+
_module?: string;
|
|
193
193
|
params?: Record<string, any>;
|
|
194
194
|
opRecords: OpRecord<ED>[];
|
|
195
195
|
[A: string]: any;
|
package/lib/types/Exception.js
CHANGED
|
@@ -5,11 +5,11 @@ const relation_1 = require("../store/relation");
|
|
|
5
5
|
const lodash_1 = require("../utils/lodash");
|
|
6
6
|
class OakException extends Error {
|
|
7
7
|
opRecords;
|
|
8
|
-
|
|
8
|
+
_module;
|
|
9
9
|
params;
|
|
10
|
-
constructor(message,
|
|
10
|
+
constructor(message, _module, params) {
|
|
11
11
|
super(message);
|
|
12
|
-
this.
|
|
12
|
+
this._module = _module;
|
|
13
13
|
this.params = params;
|
|
14
14
|
this.name = new.target.name;
|
|
15
15
|
if (typeof Error.captureStackTrace === 'function') {
|
|
@@ -79,7 +79,7 @@ class OakException extends Error {
|
|
|
79
79
|
return {
|
|
80
80
|
name: this.constructor.name,
|
|
81
81
|
message: this.message,
|
|
82
|
-
|
|
82
|
+
_module: this._module,
|
|
83
83
|
opRecords: this.opRecords,
|
|
84
84
|
tag1: this.tag1,
|
|
85
85
|
tag2: this.tag2,
|
|
@@ -116,8 +116,8 @@ exports.OakDataException = OakDataException;
|
|
|
116
116
|
class OakNoRelationDefException extends OakDataException {
|
|
117
117
|
entity;
|
|
118
118
|
actions;
|
|
119
|
-
constructor(entity, actions, msg,
|
|
120
|
-
super(msg || 'error::noRelationDef',
|
|
119
|
+
constructor(entity, actions, msg, _module, params) {
|
|
120
|
+
super(msg || 'error::noRelationDef', _module || 'oak-domain', params || {
|
|
121
121
|
entity,
|
|
122
122
|
actions: actions.join(',')
|
|
123
123
|
});
|
|
@@ -140,8 +140,8 @@ exports.OakOperExistedException = OakOperExistedException;
|
|
|
140
140
|
class OakRowUnexistedException extends OakDataException {
|
|
141
141
|
rows;
|
|
142
142
|
// 指定主键查询时却发现行不存在,一般发生在缓存中
|
|
143
|
-
constructor(rows, msg,
|
|
144
|
-
super(msg || 'error::rowUnexisted',
|
|
143
|
+
constructor(rows, msg, _module, params) {
|
|
144
|
+
super(msg || 'error::rowUnexisted', _module || 'oak-domain', params || {
|
|
145
145
|
entity: rows[0].entity,
|
|
146
146
|
});
|
|
147
147
|
this.rows = rows;
|
|
@@ -167,8 +167,8 @@ exports.OakUserException = OakUserException;
|
|
|
167
167
|
;
|
|
168
168
|
class OakUniqueViolationException extends OakUserException {
|
|
169
169
|
rows;
|
|
170
|
-
constructor(rows, message,
|
|
171
|
-
super(message || 'error::uniqViolation',
|
|
170
|
+
constructor(rows, message, _module, params) {
|
|
171
|
+
super(message || 'error::uniqViolation', _module || 'oak-domain', params);
|
|
172
172
|
this.rows = rows;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -177,8 +177,8 @@ class OakImportDataParseException extends OakUserException {
|
|
|
177
177
|
line;
|
|
178
178
|
header;
|
|
179
179
|
// message必传,描述具体错误的数据内容
|
|
180
|
-
constructor(message, line, header,
|
|
181
|
-
super(message || 'error::importedDataParseError',
|
|
180
|
+
constructor(message, line, header, _module, params) {
|
|
181
|
+
super(message || 'error::importedDataParseError', _module || 'oak-domain', params);
|
|
182
182
|
this.line = line;
|
|
183
183
|
this.header = header;
|
|
184
184
|
}
|
|
@@ -200,8 +200,8 @@ class OakClockDriftException extends OakException {
|
|
|
200
200
|
exports.OakClockDriftException = OakClockDriftException;
|
|
201
201
|
// 验签失败
|
|
202
202
|
class OakSignatureVerificationException extends OakException {
|
|
203
|
-
constructor(message,
|
|
204
|
-
super(message || 'error::signatureFailed',
|
|
203
|
+
constructor(message, _module, params) {
|
|
204
|
+
super(message || 'error::signatureFailed', _module || 'oak-domain', params);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
exports.OakSignatureVerificationException = OakSignatureVerificationException;
|
|
@@ -224,8 +224,8 @@ exports.OakRowInconsistencyException = OakRowInconsistencyException;
|
|
|
224
224
|
class OakInputIllegalException extends OakUserException {
|
|
225
225
|
attributes;
|
|
226
226
|
entity;
|
|
227
|
-
constructor(entity, attributes, message,
|
|
228
|
-
super(message,
|
|
227
|
+
constructor(entity, attributes, message, _module, params) {
|
|
228
|
+
super(message, _module, params);
|
|
229
229
|
this.entity = entity;
|
|
230
230
|
this.attributes = attributes;
|
|
231
231
|
}
|
|
@@ -253,8 +253,8 @@ exports.OakInputIllegalException = OakInputIllegalException;
|
|
|
253
253
|
* 属性为空时抛的异常
|
|
254
254
|
*/
|
|
255
255
|
class OakAttrNotNullException extends OakInputIllegalException {
|
|
256
|
-
constructor(entity, attributes, message,
|
|
257
|
-
super(entity, attributes, message || 'error::attributesNull',
|
|
256
|
+
constructor(entity, attributes, message, _module, params) {
|
|
257
|
+
super(entity, attributes, message || 'error::attributesNull', _module || 'oak-domain', params);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
exports.OakAttrNotNullException = OakAttrNotNullException;
|
|
@@ -262,8 +262,8 @@ exports.OakAttrNotNullException = OakAttrNotNullException;
|
|
|
262
262
|
* 属性不允许更新抛的异常,前端可以用这个异常来处理update时对应属性的露出
|
|
263
263
|
*/
|
|
264
264
|
class OakAttrCantUpdateException extends OakInputIllegalException {
|
|
265
|
-
constructor(entity, attributes, message,
|
|
266
|
-
super(entity, attributes, message || 'error::attributesCantUpdate',
|
|
265
|
+
constructor(entity, attributes, message, _module, params) {
|
|
266
|
+
super(entity, attributes, message || 'error::attributesCantUpdate', _module || 'oak-domain', params);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
exports.OakAttrCantUpdateException = OakAttrCantUpdateException;
|
|
@@ -273,8 +273,8 @@ exports.OakAttrCantUpdateException = OakAttrCantUpdateException;
|
|
|
273
273
|
class OakOperationUnpermittedException extends OakUserException {
|
|
274
274
|
entity;
|
|
275
275
|
operation;
|
|
276
|
-
constructor(entity, operation, message,
|
|
277
|
-
super(message || 'error::operationUnpermitted',
|
|
276
|
+
constructor(entity, operation, message, _module, params) {
|
|
277
|
+
super(message || 'error::operationUnpermitted', _module || 'oak-domain', params);
|
|
278
278
|
this.entity = entity;
|
|
279
279
|
this.operation = operation;
|
|
280
280
|
}
|
|
@@ -295,8 +295,8 @@ exports.OakOperationUnpermittedException = OakOperationUnpermittedException;
|
|
|
295
295
|
class OakDataInvisibleException extends OakUserException {
|
|
296
296
|
entity;
|
|
297
297
|
operation;
|
|
298
|
-
constructor(entity, operation, message,
|
|
299
|
-
super(message || 'error::dataInvisible',
|
|
298
|
+
constructor(entity, operation, message, _module, params) {
|
|
299
|
+
super(message || 'error::dataInvisible', _module || 'oak-domain', params);
|
|
300
300
|
this.entity = entity;
|
|
301
301
|
this.operation = operation;
|
|
302
302
|
}
|
|
@@ -315,8 +315,8 @@ exports.OakDataInvisibleException = OakDataInvisibleException;
|
|
|
315
315
|
* 用户未登录抛的异常
|
|
316
316
|
*/
|
|
317
317
|
class OakUnloggedInException extends OakUserException {
|
|
318
|
-
constructor(message,
|
|
319
|
-
super(message || 'error::unLoggedIn',
|
|
318
|
+
constructor(message, _module, params) {
|
|
319
|
+
super(message || 'error::unLoggedIn', _module || 'oak-domain', params);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
exports.OakUnloggedInException = OakUnloggedInException;
|
|
@@ -325,8 +325,8 @@ exports.OakUnloggedInException = OakUnloggedInException;
|
|
|
325
325
|
* 行数据被锁抛的异常
|
|
326
326
|
*/
|
|
327
327
|
class OakRowLockedException extends OakUserException {
|
|
328
|
-
constructor(message,
|
|
329
|
-
super(message || 'error::rowLocked',
|
|
328
|
+
constructor(message, _module, params) {
|
|
329
|
+
super(message || 'error::rowLocked', _module || 'oak-domain', params);
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
exports.OakRowLockedException = OakRowLockedException;
|
|
@@ -337,8 +337,8 @@ exports.OakRowLockedException = OakRowLockedException;
|
|
|
337
337
|
class OakCongruentRowExists extends OakUserException {
|
|
338
338
|
data;
|
|
339
339
|
entity;
|
|
340
|
-
constructor(entity, data, message,
|
|
341
|
-
super(message || 'error::congrentRowExists',
|
|
340
|
+
constructor(entity, data, message, _module, params) {
|
|
341
|
+
super(message || 'error::congrentRowExists', _module || 'oak-domain', params);
|
|
342
342
|
this.data = data;
|
|
343
343
|
this.entity = entity;
|
|
344
344
|
}
|
|
@@ -362,8 +362,8 @@ exports.OakCongruentRowExists = OakCongruentRowExists;
|
|
|
362
362
|
* 死锁抛的异常
|
|
363
363
|
*/
|
|
364
364
|
class OakDeadlock extends OakUserException {
|
|
365
|
-
constructor(message,
|
|
366
|
-
super(message || 'error::deadlock',
|
|
365
|
+
constructor(message, _module, params) {
|
|
366
|
+
super(message || 'error::deadlock', _module || 'oak-domain', params);
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
exports.OakDeadlock = OakDeadlock;
|
|
@@ -374,8 +374,8 @@ exports.OakDeadlock = OakDeadlock;
|
|
|
374
374
|
class OakPreConditionUnsetException extends OakUserException {
|
|
375
375
|
entity;
|
|
376
376
|
code;
|
|
377
|
-
constructor(message, entity, code,
|
|
378
|
-
super(message || 'error::preconditionUnset',
|
|
377
|
+
constructor(message, entity, code, _module, params) {
|
|
378
|
+
super(message || 'error::preconditionUnset', _module || 'oak-domain', params);
|
|
379
379
|
this.entity = entity,
|
|
380
380
|
this.code = code;
|
|
381
381
|
}
|
|
@@ -396,8 +396,8 @@ class OakExternalException extends OakUserException {
|
|
|
396
396
|
code;
|
|
397
397
|
source;
|
|
398
398
|
data;
|
|
399
|
-
constructor(source, code, message, data,
|
|
400
|
-
super(message || 'error::externalException',
|
|
399
|
+
constructor(source, code, message, data, _module, params) {
|
|
400
|
+
super(message || 'error::externalException', _module || 'oak-domain', params);
|
|
401
401
|
this.code = code;
|
|
402
402
|
this.source = source;
|
|
403
403
|
this.data = data;
|
|
@@ -417,118 +417,118 @@ exports.OakExternalException = OakExternalException;
|
|
|
417
417
|
* socket连接异常
|
|
418
418
|
*/
|
|
419
419
|
class OakSocketConnectException extends OakUserException {
|
|
420
|
-
constructor(message,
|
|
421
|
-
super(message || 'error::socketConnectException',
|
|
420
|
+
constructor(message, _module, params) {
|
|
421
|
+
super(message || 'error::socketConnectException', _module || 'oak-domain', params);
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
exports.OakSocketConnectException = OakSocketConnectException;
|
|
425
425
|
;
|
|
426
426
|
function makeException(data) {
|
|
427
|
-
const { name, message,
|
|
427
|
+
const { name, message, _module, params } = data;
|
|
428
428
|
let e = undefined;
|
|
429
429
|
switch (name) {
|
|
430
430
|
case 'OakException': {
|
|
431
|
-
e = new OakException(message,
|
|
431
|
+
e = new OakException(message, _module, params);
|
|
432
432
|
break;
|
|
433
433
|
}
|
|
434
434
|
case 'OakUserException': {
|
|
435
|
-
e = new OakUserException(message,
|
|
435
|
+
e = new OakUserException(message, _module, params);
|
|
436
436
|
break;
|
|
437
437
|
}
|
|
438
438
|
case 'OakRowInconsistencyException': {
|
|
439
|
-
e = new OakRowInconsistencyException(message,
|
|
439
|
+
e = new OakRowInconsistencyException(message, _module, params);
|
|
440
440
|
break;
|
|
441
441
|
}
|
|
442
442
|
case 'OakInputIllegalException': {
|
|
443
|
-
e = new OakInputIllegalException(data.entity, data.attributes, message,
|
|
443
|
+
e = new OakInputIllegalException(data.entity, data.attributes, message, _module, params);
|
|
444
444
|
break;
|
|
445
445
|
}
|
|
446
446
|
case 'OakAttrCantUpdateException': {
|
|
447
|
-
e = new OakAttrCantUpdateException(data.entity, data.attributes, message,
|
|
447
|
+
e = new OakAttrCantUpdateException(data.entity, data.attributes, message, _module, params);
|
|
448
448
|
break;
|
|
449
449
|
}
|
|
450
450
|
case 'OakOperationUnpermittedException': {
|
|
451
|
-
e = new OakOperationUnpermittedException(data.entity, data.operation, message,
|
|
451
|
+
e = new OakOperationUnpermittedException(data.entity, data.operation, message, _module, params);
|
|
452
452
|
break;
|
|
453
453
|
}
|
|
454
454
|
case 'OakDataInvisibleException': {
|
|
455
|
-
e = new OakDataInvisibleException(data.entity, data.operation, message,
|
|
455
|
+
e = new OakDataInvisibleException(data.entity, data.operation, message, _module, params);
|
|
456
456
|
break;
|
|
457
457
|
}
|
|
458
458
|
case 'OakUnloggedInException': {
|
|
459
|
-
e = new OakUnloggedInException(message,
|
|
459
|
+
e = new OakUnloggedInException(message, _module, params);
|
|
460
460
|
break;
|
|
461
461
|
}
|
|
462
462
|
case 'OakCongruentRowExists': {
|
|
463
|
-
e = new OakCongruentRowExists(data.entity, data.data, message,
|
|
463
|
+
e = new OakCongruentRowExists(data.entity, data.data, message, _module, params);
|
|
464
464
|
break;
|
|
465
465
|
}
|
|
466
466
|
case 'OakRowLockedException': {
|
|
467
|
-
e = new OakRowLockedException(message,
|
|
467
|
+
e = new OakRowLockedException(message, _module, params);
|
|
468
468
|
break;
|
|
469
469
|
}
|
|
470
470
|
case 'OakRowUnexistedException': {
|
|
471
|
-
e = new OakRowUnexistedException(data.rows, message,
|
|
471
|
+
e = new OakRowUnexistedException(data.rows, message, _module, params);
|
|
472
472
|
break;
|
|
473
473
|
}
|
|
474
474
|
case 'OakDeadlock': {
|
|
475
|
-
e = new OakDeadlock(message,
|
|
475
|
+
e = new OakDeadlock(message, _module, params);
|
|
476
476
|
break;
|
|
477
477
|
}
|
|
478
478
|
case 'OakDataException': {
|
|
479
|
-
e = new OakDataException(message,
|
|
479
|
+
e = new OakDataException(message, _module, params);
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
482
|
case 'OakNoRelationDefException': {
|
|
483
|
-
e = new OakNoRelationDefException(data.entity, data.action, message,
|
|
483
|
+
e = new OakNoRelationDefException(data.entity, data.action, message, _module, params);
|
|
484
484
|
break;
|
|
485
485
|
}
|
|
486
486
|
case 'OakUniqueViolationException': {
|
|
487
|
-
e = new OakUniqueViolationException(data.rows, message,
|
|
487
|
+
e = new OakUniqueViolationException(data.rows, message, _module, params);
|
|
488
488
|
break;
|
|
489
489
|
}
|
|
490
490
|
case 'OakImportDataParseException': {
|
|
491
|
-
e = new OakImportDataParseException(message, data.line, data.header,
|
|
491
|
+
e = new OakImportDataParseException(message, data.line, data.header, _module, params);
|
|
492
492
|
break;
|
|
493
493
|
}
|
|
494
494
|
case 'OakPreConditionUnsetException': {
|
|
495
|
-
e = new OakPreConditionUnsetException(message, data.entity, data.code,
|
|
495
|
+
e = new OakPreConditionUnsetException(message, data.entity, data.code, _module, params);
|
|
496
496
|
break;
|
|
497
497
|
}
|
|
498
498
|
case 'OakAttrNotNullException': {
|
|
499
|
-
e = new OakAttrNotNullException(data.entity, data.attributes, message,
|
|
499
|
+
e = new OakAttrNotNullException(data.entity, data.attributes, message, _module, params);
|
|
500
500
|
break;
|
|
501
501
|
}
|
|
502
502
|
case 'OakExternalException': {
|
|
503
|
-
e = new OakExternalException(data.source, data.code, message, data.data,
|
|
503
|
+
e = new OakExternalException(data.source, data.code, message, data.data, _module, params);
|
|
504
504
|
break;
|
|
505
505
|
}
|
|
506
506
|
case 'OakNetworkException': {
|
|
507
|
-
e = new OakNetworkException(message,
|
|
507
|
+
e = new OakNetworkException(message, _module, params);
|
|
508
508
|
break;
|
|
509
509
|
}
|
|
510
510
|
case 'OakClockDriftException': {
|
|
511
|
-
e = new OakClockDriftException(message,
|
|
511
|
+
e = new OakClockDriftException(message, _module, params);
|
|
512
512
|
break;
|
|
513
513
|
}
|
|
514
514
|
case 'OakServerProxyException': {
|
|
515
|
-
e = new OakServerProxyException(message,
|
|
515
|
+
e = new OakServerProxyException(message, _module, params);
|
|
516
516
|
break;
|
|
517
517
|
}
|
|
518
518
|
case 'OakSocketConnectException': {
|
|
519
|
-
e = new OakSocketConnectException(message,
|
|
519
|
+
e = new OakSocketConnectException(message, _module, params);
|
|
520
520
|
break;
|
|
521
521
|
}
|
|
522
522
|
case 'OakPartialSuccess': {
|
|
523
|
-
e = new OakPartialSuccess(message,
|
|
523
|
+
e = new OakPartialSuccess(message, _module, params);
|
|
524
524
|
break;
|
|
525
525
|
}
|
|
526
526
|
case 'OakRequestTimeoutException': {
|
|
527
|
-
e = new OakRequestTimeoutException(message,
|
|
527
|
+
e = new OakRequestTimeoutException(message, _module, params);
|
|
528
528
|
break;
|
|
529
529
|
}
|
|
530
530
|
case 'OakSignatureVerificationException': {
|
|
531
|
-
e = new OakSignatureVerificationException(message,
|
|
531
|
+
e = new OakSignatureVerificationException(message, _module, params);
|
|
532
532
|
break;
|
|
533
533
|
}
|
|
534
534
|
default:
|