Skip to content

Commit

Permalink
Update PromiseRejectionError to show error message from API response (#…
Browse files Browse the repository at this point in the history
…3868)

* Update PromiseRejectionError to show error message from API response

* Update version to 8.0.0-beta.

* Revert "Update version to 8.0.0-beta."

This reverts commit c8fa749.
  • Loading branch information
arikfr authored Jun 2, 2019
1 parent 3f8c733 commit 60b12e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/app/lib/promise-rejection-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export default class PromiseRejectionError extends Error {
message = "It seems like the page you're looking for cannot be found.";
} else if (rejection.status === 403 || rejection.status === 401) {
message = 'It seems like you don’t have permission to see this page.';
} else if (rejection.data && rejection.data.error) {
message = rejection.data.error;
}
}

Expand Down

0 comments on commit 60b12e3

Please sign in to comment.