-
Notifications
You must be signed in to change notification settings - Fork 37
Improve error message #121
Copy link
Copy link
Open
Description
When validationMetadatasToSchemas fails to generate the spec the thrown error has very little information.
The class causing the error looks like this:
export class AssessmentItemDto {
@IsString()
@MaxLength(100)
key: string;
@IsString()
@MaxLength(50)
label: string;
@IsOptional()
@IsIn([true, false, null])
value: boolean | null;
@IsString()
@MaxLength(100)
remark: string;
}The error is caused by @IsIn([true, false, null]). The error message is TypeError: undefined is not an object (evaluating 'item.type'). It would be nice if is said something like this:
Failed to generate spec while evaluating:
class: `AssessmentItemDto`,
property: `value`,
decorator:`@IsIn`,
message: `TypeError: undefined is not an object (evaluating 'item.type')`
at: (file name and line number)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels