Skip to content

Validation failed creating an issue#1895

Merged
alexr00 merged 2 commits intomasterfrom
alexr00/issue#1868
Jun 15, 2020
Merged

Validation failed creating an issue#1895
alexr00 merged 2 commits intomasterfrom
alexr00/issue#1868

Conversation

@alexr00
Copy link
Copy Markdown
Member

@alexr00 alexr00 commented Jun 12, 2020

Fixes #1868

Copy link
Copy Markdown
Contributor

@RMacfarlane RMacfarlane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

return error.message;
}
}).join(', ');
let furtherInfo: string | undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: semicolon

let furtherInfo: string | undefined
if (e.message === 'Validation Failed' && hasFieldErrors(e)) {
furtherInfo = e.errors.map(error => {
return `Value ${error.value} cannot be set for field ${error.field} (code: ${error.code})`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would surround ${error.value} in quotes to make it clear this is a user provided value

@alexr00 alexr00 merged commit 2f1bb3d into master Jun 15, 2020
@RMacfarlane RMacfarlane deleted the alexr00/issue#1868 branch November 12, 2020 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validation failed creating an issue

2 participants