mirror of
https://github.com/detleph/server.git
synced 2026-09-05 16:06:21 +02:00
Add controller for roleSchemas (unfinished)
+ Refine error messages for role schemas + Add role schema routes + Add RESULT_SCHEMA DataType + Add SchemaError.isSchemaError() type guard
This commit is contained in:
@@ -52,7 +52,7 @@ export function parseSchema(schema: any): DurationSchemaT | PointSchemaT {
|
||||
const issue = e.issues.at(0);
|
||||
|
||||
if (issue) {
|
||||
throw new SchemaError(`${issue.path}: ${issue.message}`);
|
||||
throw new SchemaError(`Error with the schema: ${issue.path ? `${issue.path}:` : ""} ${issue.message}`);
|
||||
}
|
||||
|
||||
throw new SchemaError("Unknown error occured while validating the schema");
|
||||
@@ -61,5 +61,5 @@ export function parseSchema(schema: any): DurationSchemaT | PointSchemaT {
|
||||
throw e;
|
||||
}
|
||||
|
||||
throw new SchemaError("type must be either 'duration' or 'points'");
|
||||
throw new SchemaError("Error with the schema: type must be either 'duration' or 'points'");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user