In the good case my JSON endpoint will return a proper JSON response: {status: "success"}. However if my webserver 500 errors the 500 response body is HTML, which results in a SyntaxError if jQuery tries to parse it with $.parseJSON.
This question suggests just removing the dataType param from the request. I would rather not do that, is there a way to try/catch the SyntaxError thats raised by a non-JSON response?
From jQuery API
You can handle it the error callback.