Skip to content

bugfix: handle if errors is not an array#1025

Open
ashley-conpago wants to merge 1 commit into
mercurius-js:masterfrom
ashley-conpago:bugfix/defaultErrorFormatter-handle-non-array-errors
Open

bugfix: handle if errors is not an array#1025
ashley-conpago wants to merge 1 commit into
mercurius-js:masterfrom
ashley-conpago:bugfix/defaultErrorFormatter-handle-non-array-errors

Conversation

@ashley-conpago

Copy link
Copy Markdown

closes #1024

  • check that error.originalError.errors is an array before mapping it.
  • if not an array, but is defined, try to handle it anyway.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for opening a PR! Can you please add a unit test?

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.

Occasional "error.originalError.errors.map is not a function" errors

2 participants