Skip to content

Commit 04d54bb

Browse files
diningPhilosopher64prabhakk-mw
authored andcommitted
Bugfix: Status Icon in panel shows incorrect connection state
1 parent 1ee419f commit 04d54bb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

gui/src/actionCreators/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ export async function fetchWithTimeout(dispatch, resource, options={}, timeout=1
147147
clearTimeout(id);
148148

149149
return response;
150-
} catch(error) {
150+
} catch(err) {
151+
const errorText = 'Check your internet connection and verify that the server is running.';
151152
// If AbortController is aborted, then AbortError exception is raised due to time out.
152-
if (error.name === "AbortError"){
153-
dispatch(receiveError(`HTTP Error 408 - Request Timeout. Check your internet connection and, verify that the server is running.`,408))
153+
if (err.name === "AbortError" || err.name === 'TypeError') {
154+
dispatch(receiveError(`HTTP Error 408 - Request Timeout. ${errorText}`,408))
154155
} else {
155-
dispatch(receiveError("Communication with server failed.",404))
156+
dispatch(receiveError("Communication with server failed.", 500))
156157
}
157158
}
158159
}

0 commit comments

Comments
 (0)