As per jQuery docs, jqXHR object only contains responseJSON property if there is correct content-type header. https://api.jquery.com/jQuery.ajax/#jqXHR -> Data Types.
In this PR, I have handled the error case by falling back to responseText object instead of constructing {"status": ..., "error": ...} object which was causing confusion
Closes #175
As per jQuery docs,
jqXHR
object only containsresponseJSON
property if there is correctcontent-type
header. https://api.jquery.com/jQuery.ajax/#jqXHR -> Data Types.In this PR, I have handled the error case by falling back to
responseText
object instead of constructing{"status": ..., "error": ...}
object which was causing confusion