diff --git a/html/app.js b/html/app.js index 8b83d00c..93cf3130 100644 --- a/html/app.js +++ b/html/app.js @@ -311,20 +311,23 @@ CefSharp.BindObjectAsync( text: escapeTag(json.success.message) }).show(); } - } else if (isObject(json.error)) { - this.$throw( - json.error.status_code || res.status, - json.error.message, - json.error.data - ); - } else if (typeof json.error === 'string') { - this.$throw( - json.status_code || res.status, - json.error - ); - } else { - this.$throw(res.status, json); + return json; } + if (isObject(json)) { + if (isObject(json.error)) { + this.$throw( + json.error.status_code || res.status, + json.error.message, + json.error.data + ); + } else if (typeof json.error === 'string') { + this.$throw( + json.status_code || res.status, + json.error + ); + } + } + this.$throw(res.status, json); return json; })); if (isGetRequest) { diff --git a/html/vr.js b/html/vr.js index 6cac3746..b18de8d9 100644 --- a/html/vr.js +++ b/html/vr.js @@ -248,20 +248,23 @@ CefSharp.BindObjectAsync( text: escapeTag(json.success.message) }).show(); } - } else if (isObject(json.error)) { - this.$throw( - json.error.status_code || res.status, - json.error.message, - json.error.data - ); - } else if (typeof json.error === 'string') { - this.$throw( - json.status_code || res.status, - json.error - ); - } else { - this.$throw(res.status, json); + return json; } + if (isObject(json)) { + if (isObject(json.error)) { + this.$throw( + json.error.status_code || res.status, + json.error.message, + json.error.data + ); + } else if (typeof json.error === 'string') { + this.$throw( + json.status_code || res.status, + json.error + ); + } + } + this.$throw(res.status, json); return json; })); if (isGetRequest) {