mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 19:51:53 +00:00
Error object fix
Source: https://github.com/hapijs/joi/blob/master/API.md#errors ## Errors Joi throws classical javascript `Error`s containing : - `name` - `'ValidationError'`. - `isJoi` - `true`. - `details` - an array of errors : - `message` - string with a description of the error. - `path` - dotted path to the key where the error happened. - `type` - type of the error. - `context` - object providing context of the error. - `annotate` - function that returns a string with an annotated version of the object pointing at the places where errors occured. - `_object` - the original object to validate.
This commit is contained in:
Vendored
+4
-4
@@ -121,17 +121,17 @@ export interface IPOptions {
|
||||
}
|
||||
|
||||
export interface ValidationError extends Error {
|
||||
message: string;
|
||||
isJoi: boolean;
|
||||
details: ValidationErrorItem[];
|
||||
simple(): string;
|
||||
annotated(): string;
|
||||
annotate(): string;
|
||||
_object: any;
|
||||
}
|
||||
|
||||
export interface ValidationErrorItem {
|
||||
message: string;
|
||||
type: string;
|
||||
path: string;
|
||||
options?: ValidationOptions;
|
||||
context?: any;
|
||||
}
|
||||
|
||||
export interface ValidationResult<T> {
|
||||
|
||||
Reference in New Issue
Block a user