From 60b12e31210e2692239633c7f32acf782b023775 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 2 Jun 2019 11:47:26 +0300 Subject: [PATCH] Update PromiseRejectionError to show error message from API response (#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 c8fa74967fcce49aabc86c13b39fb93653ed9b32. --- client/app/lib/promise-rejection-error.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/app/lib/promise-rejection-error.js b/client/app/lib/promise-rejection-error.js index ada9323670..bb19f62268 100644 --- a/client/app/lib/promise-rejection-error.js +++ b/client/app/lib/promise-rejection-error.js @@ -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; } }