[request] Clearer error message for JSON deserialization failure (#2195)
This commit is contained in:
parent
e46d03f467
commit
fd7cf8041e
3 changed files with 3 additions and 2 deletions
|
|
@ -162,7 +162,7 @@ module.exports = function($window, Promise) {
|
|||
|
||||
function deserialize(data) {
|
||||
try {return data !== "" ? JSON.parse(data) : null}
|
||||
catch (e) {throw new Error(data)}
|
||||
catch (e) {throw new Error("Invalid JSON: " + data)}
|
||||
}
|
||||
|
||||
function extract(xhr) {return xhr.responseText}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue