@autofleet/sadot 0.7.10-beta.2 → 0.7.10-beta.4
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/errors/index.js +12 -6
- package/package.json +1 -1
- package/src/errors/index.ts +12 -6
package/dist/errors/index.js
CHANGED
|
@@ -42,13 +42,19 @@ class InvalidValueError extends errors_1.BadRequest {
|
|
|
42
42
|
.replace('value', fieldDefinitionName);
|
|
43
43
|
const formattedValue = typeof value === 'object' ? JSON.stringify(value) : value;
|
|
44
44
|
const detailedMessage = `
|
|
45
|
-
Invalid value for field ${fieldDefinitionName}
|
|
46
|
-
Received: ${formattedValue}
|
|
47
|
-
Error: ${formattedErrorMessage}
|
|
48
|
-
`.trim();
|
|
45
|
+
Invalid value for field ${fieldDefinitionName} Received: ${formattedValue} Error: ${formattedErrorMessage}`.trim();
|
|
49
46
|
const err = new Error(detailedMessage);
|
|
50
|
-
super([err], null,
|
|
51
|
-
|
|
47
|
+
super([err], null, {
|
|
48
|
+
field: fieldDefinitionName,
|
|
49
|
+
value,
|
|
50
|
+
error: joiValidationError,
|
|
51
|
+
});
|
|
52
|
+
this.message = 'INVALID_VALUE';
|
|
53
|
+
this.payload = {
|
|
54
|
+
field: fieldDefinitionName,
|
|
55
|
+
value,
|
|
56
|
+
error: joiValidationError,
|
|
57
|
+
};
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
60
|
exports.InvalidValueError = InvalidValueError;
|
package/package.json
CHANGED
package/src/errors/index.ts
CHANGED
|
@@ -43,14 +43,20 @@ export class InvalidValueError extends BadRequest {
|
|
|
43
43
|
const formattedValue = typeof value === 'object' ? JSON.stringify(value) : value;
|
|
44
44
|
|
|
45
45
|
const detailedMessage = `
|
|
46
|
-
Invalid value for field ${fieldDefinitionName}
|
|
47
|
-
Received: ${formattedValue}
|
|
48
|
-
Error: ${formattedErrorMessage}
|
|
49
|
-
`.trim();
|
|
46
|
+
Invalid value for field ${fieldDefinitionName} Received: ${formattedValue} Error: ${formattedErrorMessage}`.trim();
|
|
50
47
|
|
|
51
48
|
const err = new Error(detailedMessage);
|
|
52
|
-
super([err], null,
|
|
53
|
-
|
|
49
|
+
super([err], null, {
|
|
50
|
+
field: fieldDefinitionName,
|
|
51
|
+
value,
|
|
52
|
+
error: joiValidationError,
|
|
53
|
+
});
|
|
54
|
+
this.message = 'INVALID_VALUE';
|
|
55
|
+
this.payload = {
|
|
56
|
+
field: fieldDefinitionName,
|
|
57
|
+
value,
|
|
58
|
+
error: joiValidationError,
|
|
59
|
+
};
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
62
|
|