Skip to content
Snippets Groups Projects
Commit 63f8bbc6 authored by Jessie Keck's avatar Jessie Keck
Browse files

Handle object type errors being returned from fetchManifest (by casting to a string).

parent 15612390
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,13 @@ export function fetchManifest(manifestId, properties) { ...@@ -58,7 +58,13 @@ export function fetchManifest(manifestId, properties) {
return fetch(manifestId) return fetch(manifestId)
.then(response => response.json()) .then(response => response.json())
.then(json => dispatch(receiveManifest(manifestId, json))) .then(json => dispatch(receiveManifest(manifestId, json)))
.catch(error => dispatch(receiveManifestFailure(manifestId, error))); .catch((error) => {
if (typeof error === 'object') { // Returned by JSON parse failure
dispatch(receiveManifestFailure(manifestId, String(error)));
} else {
dispatch(receiveManifestFailure(manifestId, error));
}
});
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment