Skip to content
This repository has been 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

Commits on Jul 8, 2016

  1. "400 Version Mismatch" error handling

    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 committed Jul 8, 2016
    Configuration menu
    Copy the full SHA
    e4c0aaf View commit details
    Browse the repository at this point in the history
  2. Refactor error handling

    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 committed Jul 8, 2016
    Configuration menu
    Copy the full SHA
    690dc9d View commit details
    Browse the repository at this point in the history
  3. "503 Maintenance" error handling

    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 committed Jul 8, 2016
    Configuration menu
    Copy the full SHA
    13df2e4 View commit details
    Browse the repository at this point in the history