@fjell/core 4.4.62 → 4.4.63
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.
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { ActionError } from './ActionError';
|
|
2
|
+
export interface FieldError {
|
|
3
|
+
path: (string | number)[];
|
|
4
|
+
message: string;
|
|
5
|
+
code: string;
|
|
6
|
+
}
|
|
2
7
|
export declare class ValidationError extends ActionError {
|
|
3
|
-
|
|
8
|
+
fieldErrors?: FieldError[];
|
|
9
|
+
constructor(message: string, validOptions?: string[], suggestedAction?: string, conflictingValue?: any, fieldErrors?: FieldError[]);
|
|
4
10
|
}
|
package/dist/index.js
CHANGED
|
@@ -1300,7 +1300,8 @@ var ActionError = class extends Error {
|
|
|
1300
1300
|
|
|
1301
1301
|
// src/errors/ValidationError.ts
|
|
1302
1302
|
var ValidationError = class extends ActionError {
|
|
1303
|
-
|
|
1303
|
+
fieldErrors;
|
|
1304
|
+
constructor(message, validOptions, suggestedAction, conflictingValue, fieldErrors) {
|
|
1304
1305
|
super({
|
|
1305
1306
|
code: "VALIDATION_ERROR",
|
|
1306
1307
|
message,
|
|
@@ -1312,12 +1313,18 @@ var ValidationError = class extends ActionError {
|
|
|
1312
1313
|
validOptions,
|
|
1313
1314
|
suggestedAction,
|
|
1314
1315
|
retryable: true,
|
|
1315
|
-
conflictingValue
|
|
1316
|
+
conflictingValue,
|
|
1317
|
+
fieldErrors
|
|
1316
1318
|
},
|
|
1317
1319
|
technical: {
|
|
1318
1320
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1319
1321
|
}
|
|
1320
1322
|
});
|
|
1323
|
+
this.fieldErrors = fieldErrors;
|
|
1324
|
+
if (fieldErrors) {
|
|
1325
|
+
if (!this.errorInfo.details) this.errorInfo.details = {};
|
|
1326
|
+
this.errorInfo.details.fieldErrors = fieldErrors;
|
|
1327
|
+
}
|
|
1321
1328
|
}
|
|
1322
1329
|
};
|
|
1323
1330
|
|