Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #748 Ensure FederatedError errors argument is an array. #749

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

tomi-bigpi
Copy link
Contributor

  • Add constructor argument validation to FederatedError to ensure errors is an Array
  • Add input validation tests for FederatedError constructor argument
  • Fix request and sendRequest to wrap caught errors in array when creating new FederatedError
  • Add new test file for request to ensure array is used
  • Modify existing sendRequest test to verify array is used
  • Add support for passing in undici agent as part of the federated service configuration. Required for injection during tests. See MockAgent don't intercept Pool requests nodejs/undici#996

Fixes #748

* Add constructor argument validation to `FederatedError` to ensure `errors` is an Array
* Add input validation tests for FederatedError constructor argument
* Fix `request` and `sendRequest` to wrap caught errors in array when creating new `FederatedError`
* Add new test file for `request` to ensure array is used
* Modify existing `sendRequest` test to verify array is used
* Add support for passing in undici agent as part of the federated service configuration. Required for injection during tests. See nodejs/undici#996
Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Collaborator

mcollina commented Mar 9, 2022

Could you please document the new agent option?

@mcollina mcollina merged commit afb3b62 into mercurius-js:master Mar 9, 2022
@tomi-bigpi tomi-bigpi deleted the fix-748 branch March 9, 2022 15:07
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.

defaultErrorFormatter throws error for federated errors (when downstream service can't be reached)
2 participants