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

unintuitive errors on renderComponents #191

Closed
maxgurewitz opened this issue Feb 24, 2016 · 1 comment · Fixed by #197
Closed

unintuitive errors on renderComponents #191

maxgurewitz opened this issue Feb 24, 2016 · 1 comment · Fixed by #197

Comments

@maxgurewitz
Copy link

The renderComponents function should respond with more intuitive errors.

renderComponents responds with an array of [undefined, undefined ... ] on success. Instead, on success, the passed error should simply be null.

On failure it responds with,

["Server-side rendering failed", "Server-side rendering failed"... ]

It should probably respond with more descriptive error messages. In my case I was missing a language header, and it would have been useful to have been told that!

You might consider using something like joi to handle param validation and error message generation!

@matteofigus
Copy link
Member

Thanks @maxgurewitz

  1. Depending on the usage, you may be interested on doing different things if something fails or succeeds.
  • I agree that we should send just a null if we have no errors at all
  • I think that in case we have some errors, we should have null instead of undefined for the response[x][0]. Do you agree?
  1. The API responds with some details, the client just generically says it has some problems. So, I think here is just about leveraging the client in order to pass the error here - I agree.

  2. In regards of the param validation, that happens in the API when receiving request - in fact each component has a specific way to handle parameters parsing and respond with proper error. So, here, as 2), I think it is just a matter of making the client to forward the error details to the error callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants