Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

"503 Maintenance" error handling #112

Merged
merged 3 commits into from
Jul 11, 2016

Conversation

kevinansfield
Copy link
Member

refs TryGhost/Ghost#6976

  • adds custom MaintenanceError and associated error checking functions
  • updates app route and notifications service to handle 503 errors via the upgrade-status service

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
@acburdine
Copy link
Member

@kevinansfield do you want all of these to get merged at the same time?

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
refs TryGhost/Ghost#6976
- adds custom `MaintenanceError` and associated error checking functions
- updates app route and notifications service to handle `503` errors via the `upgrade-status` service
@kevinansfield
Copy link
Member Author

If possible as they do all build on each other. I would normally squash them down into 1 PR but I think in this case having the separated commits with their already large commit messages will be better?

@acburdine
Copy link
Member

ok, I will get them looked at today/this weekend (still stuck deep in validations refactoring 😄)

@acburdine
Copy link
Member

LGTM!

@acburdine acburdine merged commit a2c6b94 into TryGhost:master Jul 11, 2016
@kevinansfield kevinansfield deleted the 503-maintenance branch February 4, 2017 10:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants