Skip to content

Commit

Permalink
add printing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed May 12, 2024
1 parent 2aec625 commit df95655
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/DialogBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class DialogBox {
// Check JsonSchema
if(!validate(dialog)) {
sails.log.error(`${dialog} not match with config schema`)
sails.log.error(validate.errors)
sails.log.error(JSON.stringify(validate.errors, null, 2))
throw `DialogBox config not valid`
}

Expand Down
4 changes: 2 additions & 2 deletions models/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,13 @@ let Model = {
// undefined if value is from input, null if value is from origSettings
if (settingsSetInput.value !== undefined && settingsSetInput.value !== null && !validate(settingsSetInput.value)) {
let mErr = 'AJV Validation Error: Value does not match the schema, see logs for more info';
sails.log.error(mErr, validate.errors);
sails.log.error(mErr, JSON.stringify(validate.errors, null, 2));
throw mErr
}

if (settingsSetInput.defaultValue !== undefined && settingsSetInput.defaultValue !== null && !validate(settingsSetInput.defaultValue)) {
let mErr = 'AJV Validation Error: DefaultValue does not match the schema, see logs for more info';
sails.log.error(mErr, validate.errors);
sails.log.error(mErr, JSON.stringify(validate.errors, null, 2));
throw mErr
}
}
Expand Down

0 comments on commit df95655

Please sign in to comment.