Permalink
Browse files

Handling for parse errors on the response.

  • Loading branch information...
1 parent 805d0b8 commit a23bd9acc972386852162e0f1a8e193f57e06bc3 @cmeiklejohn cmeiklejohn committed Apr 12, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 priv/admin/js/cluster.js
View
@@ -352,8 +352,12 @@ minispade.register('cluster', function() {
var parsed, errors;
if(jqXHR) {
- parsed = JSON.parse(jqXHR.responseText);
- errors = parsed.errors.join(', ');
+ try {
+ parsed = JSON.parse(jqXHR.responseText);
+ errors = parsed.errors.join(', ');
+ } catch(err) {
+ errors = errorThrown;
+ }
} else {
errors = errorThrown;
}

0 comments on commit a23bd9a

Please sign in to comment.