diff options
Diffstat (limited to 'src/components/List.js')
-rw-r--r-- | src/components/List.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/List.js b/src/components/List.js index 0bf359b..e526c4b 100644 --- a/src/components/List.js +++ b/src/components/List.js @@ -60,7 +60,9 @@ class List extends React.Component { // TODO: Look at `status` or return code or both? .then(resp => { if (resp.status !== 200) - throw `Unexpected HTTP response code from soc_collector: ${resp.status} ${resp.statusText}`; + throw new Error( + `Unexpected HTTP response code from soc_collector: ${resp.status} ${resp.statusText}` + ); this.setState({ totalPages: parseInt(resp.headers.get("X-Total-Count")) }); @@ -68,7 +70,9 @@ class List extends React.Component { }) .then(json => { if (json.status != "success") - throw `Unexpected status from soc_collector: ${json.status}`; + throw new Error( + `Unexpected status from soc_collector: ${json.status}` + ); this.setState({ objects: json.docs }); |