We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da5b99c commit a6bfbd1Copy full SHA for a6bfbd1
apps/api/src/instrument-records/instrument-records.service.ts
@@ -67,10 +67,12 @@ export class InstrumentRecordsService {
67
68
const parseResult = instrument.validationSchema.safeParse(this.parseJson(rawData));
69
if (!parseResult.success) {
70
- console.error(parseResult.error.issues);
71
- throw new UnprocessableEntityException(
72
- `Data received for record does not pass validation schema of instrument '${instrument.id}'`
73
- );
+ throw new UnprocessableEntityException({
+ error: 'Unprocessable Entity',
+ issues: parseResult.error.issues,
+ message: `Data received for record does not pass validation schema of instrument '${instrument.id}'`,
74
+ statusCode: 422
75
+ });
76
}
77
78
return this.instrumentRecordModel.create({
0 commit comments