From ac8ba5b8248ffabaf0e124e120704b506f872abc Mon Sep 17 00:00:00 2001 From: pypy Date: Mon, 13 Jan 2020 22:04:20 +0900 Subject: [PATCH] bugfix --- html/app.js | 29 ++++++++++++++++------------- html/vr.js | 29 ++++++++++++++++------------- 2 files changed, 32 insertions(+), 26 deletions(-) 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) {