summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/List.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/components/List.js b/src/components/List.js
index 5f12aa0..bc74020 100644
--- a/src/components/List.js
+++ b/src/components/List.js
@@ -30,7 +30,14 @@ class List extends React.Component {
}
})
.then(resp => resp.json())
- .then(data => this.setState({ objects: data }));
+ .then(resp => {
+ // TODO: Look at `status` or return code or both?
+ if (resp.status != "success")
+ throw `soc_collector responded: ${resp.status}`;
+ return resp;
+ })
+ .then(resp => this.setState({ objects: resp.data }))
+ .catch(e => this.props.setError(e));
}
filter(field, value) {