diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-11 23:18:41 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-11 23:18:41 +0100 |
commit | f92cb02b9bc4b6b09c48dee72ac3a9f0de213dc3 (patch) | |
tree | d72526639d13ed3a22563f9d53805159d35092c0 /app/assets/javascripts | |
parent | 2b22c3303923928bb10ab64130bbf924e2f0de65 (diff) |
Fix #203 - try/catch around JSON parse
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/components/api.jsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/api.jsx b/app/assets/javascripts/components/api.jsx index 080c2bd6a..93cfc8046 100644 --- a/app/assets/javascripts/components/api.jsx +++ b/app/assets/javascripts/components/api.jsx @@ -17,6 +17,10 @@ export default getState => axios.create({ }, transformResponse: [function (data) { - return JSON.parse(data); + try { + return JSON.parse(data); + } catch(Exception) { + return data; + } }] }); |