Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
feat(sdk): return detailed error message if input format is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
LeilaWang committed Feb 12, 2020
1 parent 9899c4c commit c12c1f6
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ export default function validateParameters(query, args) {

const errorMsg = schema.validate(args);
if (errorMsg) {
return argsError('input.invalid', {
message: errorMsg,
});
const errorResp = argsError('input.invalid');
return {
...errorResp,
error: {
...errorResp.error,
message: errorMsg,
},
};
}

return null;
Expand Down

0 comments on commit c12c1f6

Please sign in to comment.