Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Fixed route and other error handling #923

Merged
merged 2 commits into from
Jan 5, 2017
Merged

Conversation

msecret
Copy link
Contributor

@msecret msecret commented Jan 5, 2017

A change, maybe in axios ajax module, maybe somewhere else changed
the error responses so the actual data resides in a response object
within the error object. This was breaking the error catching. The
fix is the pass the error response object to the handleError
function so the correct data is supplied to it so it can pass the
error correctly to the UI with the correct information.

Additionally, the route store wasn't resetting the route loading state after
and error, which was causing the editing loading text to appear after any
error.

Ref #915

@adborden
Copy link
Contributor

adborden commented Jan 5, 2017

Not sure this should be applied globally to all the errors. The catch could be catching any error, not just from axios which might not have a response property. Might be better to have a clause in the handleError that checks for the response property instead.

A change, maybe in axios ajax module, maybe somewhere else changed
the error responses so the actual data resides in a `response` object
within the error object. This was breaking the error catching. The
fix is the pass the error `response` object to the `handleError`
function so the correct data is supplied to it so it can pass the
error correctly to the UI with the correct information.
@msecret msecret force-pushed the ms-fix_route_error_handling branch from 03e63a2 to 0830624 Compare January 5, 2017 19:37
The CF API should now use the new axios error format of having the
error data nested in the `response` object. Also changes the naming
convention of this fake error in an attempt to make it more clear what
it is in the tests. Only modified this where the tests were failing.

I also added a catch to promises in the cf api code, to ensure that
when a piece of code failed in the error or other handlers, it wouldn't
time out but would provide a good error message to the developer
testing.
@msecret msecret merged commit d7d37d5 into master Jan 5, 2017
@msecret msecret deleted the ms-fix_route_error_handling branch January 5, 2017 22:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants