Skip to content

Http error handling#1273

Merged
Kmaschta merged 11 commits intomasterfrom
http-error-handling
Dec 20, 2016
Merged

Http error handling#1273
Kmaschta merged 11 commits intomasterfrom
http-error-handling

Conversation

@Phocea
Copy link
Copy Markdown
Contributor

@Phocea Phocea commented Dec 9, 2016

Hopefully the final chapter :)
I have modified the documentation example and using similar code our deployment

@Phocea
Copy link
Copy Markdown
Contributor Author

Phocea commented Dec 9, 2016

Replace #1257 .. was getting too messy

@Phocea
Copy link
Copy Markdown
Contributor Author

Phocea commented Dec 9, 2016

@jpetitcolas All yours :)

@Phocea
Copy link
Copy Markdown
Contributor Author

Phocea commented Dec 10, 2016

Fix #1031

@jpetitcolas jpetitcolas added this to the 1.0 milestone Dec 15, 2016
doc/Theming.md Outdated
```
Bind the decorator to your application:
```js
myApp.decorator('httpErrorService',require('HttpErrorDecorator'));
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.

s/httpErrorService/HttpErrorService/

Copy link
Copy Markdown
Contributor

@jpetitcolas jpetitcolas left a comment

Choose a reason for hiding this comment

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

Fine to me. I brought a few minor changes (essentially some renaming from httpErrorService to HttpErrorService). I also tested documentation, everything is good. Mergeable if tests are green.

@jpetitcolas
Copy link
Copy Markdown
Contributor

Tests are green. @Kmaschta, I let you merge?

Copy link
Copy Markdown
Contributor

@Kmaschta Kmaschta left a comment

Choose a reason for hiding this comment

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

Great work, it will be easier for all.

A final review with few details and we're good!

this.handle404Error(event, error);
break;
case 403:
this.handle403Error(error);
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.

Please, be consistent and give the same API for all the handlers: (event, error) or (error, event).
I'm even in favor of (error, event, toState, toParams, fromState, fromParams).

It will be more customable for the next developers and the doc will be more clear too.

Copy link
Copy Markdown
Contributor Author

@Phocea Phocea Dec 20, 2016

Choose a reason for hiding this comment

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

if you do this I get sonar style check errors because the parameters are not used in the method (Unused function parameters should be removed javascript : UnusedFunctionArgument)
Nothing is mentionned about this in google guidelines.

Dev can override this in the decorator anyway

'NEXT': 'Next »',
'DETAIL': 'Detail',
'STATE_CHANGE_ERROR': 'State change error: {{ message }}',
'STATE_FORBIDDEN_ERROR': 'A server 403 error occured: {{ message }}',
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.

A server 403 error occured to A permission error occured?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well 403 error could be something else than permission, so not sure. I will let you debate with @jpetitcolas as this was is wording for the error when we started discussing this issue (#1031 (comment))

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.

Let use current message, as it will be useful for users to report problem to their developper. Moreover, it is easily overridable now.

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.

Ok

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.

3 participants