This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
Error handling refactor #65
Merged
acburdine
merged 2 commits into
TryGhost:master
from
kevinansfield:error-handling-refactor
Jul 11, 2016
Merged
Error handling refactor #65
acburdine
merged 2 commits into
TryGhost:master
from
kevinansfield:error-handling-refactor
Jul 11, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kevinansfield
force-pushed
the
error-handling-refactor
branch
2 times, most recently
from
June 15, 2016 17:17
ce9f9b8
to
e0942fb
Compare
import {isBlank} from 'ember-utils'; | ||
import {A as emberA, isEmberArray} from 'ember-array/utils'; | ||
import {filter} from 'ember-computed'; | ||
import {dasherize} from 'ember-string'; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
kevinansfield
force-pushed
the
error-handling-refactor
branch
2 times, most recently
from
June 16, 2016 16:54
b394137
to
948115a
Compare
Found some more edge cases while working on the version mismatch handling 😞 |
kevinansfield
force-pushed
the
error-handling-refactor
branch
from
June 17, 2016 13:03
948115a
to
fea7850
Compare
8 tasks
kevinansfield
force-pushed
the
error-handling-refactor
branch
3 times, most recently
from
July 7, 2016 11:11
d3d8b70
to
c24f503
Compare
refs TryGhost/Ghost#6949 Handle version mismatch errors by: - displaying an alert asking the user to copy any data and refresh - disabling navigation so that unsaved data is not accidentally lost Detailed changes: - add `error` action to application route for global route-based error handling - remove 404-handler mixin, move logic into app route error handler - update `.catch` in validation-engine so that promises are rejected with the original error objects - add `VersionMismatchError` and `isVersionMismatchError` to ajax service - add `upgrade-status` service - has a method to trigger the alert and toggle the "upgrade required" mode - is injected into all routes by default so that it can be checked before transitioning - add `Route` override - updates the `willTransition` hook to check the `upgrade-status` service and abort the transition if we're in "upgrade required" mode - update notifications `showAPIError` method to handle version mismatch errors - update any areas where we were catching ajax errors manually so that the version mismatch error handling is obeyed - fix redirect tests in editor acceptance test - fix mirage's handling of 404s for unknown posts in get post requests - adjust alert z-index to to appear above modal backgrounds
kevinansfield
force-pushed
the
error-handling-refactor
branch
from
July 8, 2016 13:59
c24f503
to
bfafc8e
Compare
closes TryGhost/Ghost#6974 - update "change password" fields/process to use inline validations - remove `notifications.showErrors` and update all uses of it to `showAPIError` - display multiple API errors as alerts rather than toaster notifications - refactor `notifications.showAPIError` - remove `notifications.showErrors`, use a loop in `showAPIError` instead - properly determine the message from `AjaxError` or `AdapterError` objects - determine a unique key if possible so that we don't lose multiple different alerts - add `ServerUnreachable` error for when we get a status code of 0 (eg, when the ghost service has been shut down) - simplify error messages for our custom ajax errors
kevinansfield
force-pushed
the
error-handling-refactor
branch
from
July 8, 2016 14:17
bfafc8e
to
690dc9d
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes TryGhost/Ghost#6974
notifications.showErrors
and update all uses of it toshowAPIError
notifications.showAPIError
notifications.showErrors
, use a loop inshowAPIError
insteadAjaxError
orAdapterError
objectsServerUnreachable
error for when we get a status code of 0 (eg, when the ghost service has been shut down)TODO:
notifications.showErrors
(rename to_showErrors
to signify it being an internal method)._showErrors
to use alerts instead of toaster notificationsnotifications.showAPIError
notifications.showAPIError
getRequestErrorMessage