From c3c1b18bac76ed4745ded216e14a3d581eab8e2e Mon Sep 17 00:00:00 2001
From: Patrizio Bekerle <patrizio.bekerle@tugraz.at>
Date: Tue, 22 Oct 2019 12:01:58 +0200
Subject: [PATCH] Fix handleFetchError error message for TypeError errors with
 message

---
 packages/common/error.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/common/error.js b/packages/common/error.js
index 3c14abae..e1acbab8 100644
--- a/packages/common/error.js
+++ b/packages/common/error.js
@@ -43,9 +43,9 @@ export const handleFetchError = async (error, summary = "") => {
             body = error.statusText !== undefined ? error.statusText : error;
         });
     } catch (e) {
-        // we get a TypeError if the connection to the server was refused
+        // a TypeError means the connection to the server was refused most of the times
         if (error.name === "TypeError") {
-            body = i18n.t('error.connection-to-server-refused');
+            body = error.message !== "" ? error.message : i18n.t('error.connection-to-server-refused');
         }
     }
 
-- 
GitLab