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

Client errors #291

Merged
merged 10 commits into from
Sep 20, 2016
Merged

Client errors #291

merged 10 commits into from
Sep 20, 2016

Conversation

matteofigus
Copy link
Member

This follows #288 - basically tackles 2 things:

  1. When error happens for HTTP request to registry POST route, log contains all the request details
  2. When HTTP request to registry happens and the requests times-out, it doesn't (erroneously) say it's a 500 anymore - but shows it is a timeout instead.

@matteofigus matteofigus removed the wip label Sep 19, 2016
it('should contain the error details', function(){

var exp = getRegExpFromJson(expectedRequest),
expected = new RegExp('Error: Server-side rendering failed: request ' + exp + ' failed \\(timeout\\)');
Copy link
Member

Choose a reason for hiding this comment

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

@matteofigus is it worth including actual timeout value in the error message as well (for diagnostic purposes)

Copy link
Member Author

Choose a reason for hiding this comment

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

It is there. The client has a default overridable timeout value that is always passed through the request call. Now we log all the arguments that we pass to that function call ( a JSON.stringify of expectedRequest - a couple of lines up) - which contains timeout, headers, body payload, everything.

An example of an error (I censored some private data stuff):

[Error: Server-side rendering failed: request {"url":"http://xxx","method":"post","headers":{"accept-language":"fr-CA, fr, en, *","ot-requestid":"xxx","ot-referringhost":"127.0.0.1","ot-referringservice":"xxx","accept":"application/vnd.oc.unrendered+json","user-agent":"oc-client-1.10.0/v4.4.4-darwin-x64"},"timeout":5,"json":true,"body":{"components":[{"name":"xxx","parameters":{xxx},"version":"1.2.0"}]}} failed (timeout)] ]

@matteofigus matteofigus merged commit fae85c4 into master Sep 20, 2016
@matteofigus matteofigus deleted the client-errors branch September 20, 2016 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants