From 3ea920d1693353e9db14ea954fb93ce78491b85e Mon Sep 17 00:00:00 2001 From: Selim Mustafaev Date: Tue, 12 Jan 2021 23:45:58 +0300 Subject: [PATCH] Fix error with wrong debug info --- data_providers/vin01.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data_providers/vin01.js b/data_providers/vin01.js index 5970f93..8ebabd6 100644 --- a/data_providers/vin01.js +++ b/data_providers/vin01.js @@ -40,14 +40,14 @@ class Vin01Provider { result.value = json.data; return result; } else { - return { status: 'rejected', reason: `[${json.data.status}] ${json.data.message}` }; + return { status: 'rejected', reason: Error(`[${json.data.status}] ${json.data.message}`) }; } } else { result.value = json.data; return result; } } else { - return { status: 'rejected', reason: `[${json.status}] ${json.code}` }; + return { status: 'rejected', reason: Error(`[${json.status}] ${json.code}`) }; } } else { return result; @@ -62,8 +62,8 @@ class Vin01Provider { let checks = [Vin01Provider.runCheck('base', vin, token), Vin01Provider.runCheck('history', vin, token)]; let [base, history] = (await Promise.allSettled(checks)).map(Vin01Provider.checkErrors); if(base.status == 'rejected' && history.status == 'rejected') { - console.log('Vin01 base error: ', base.reason); - console.log('Vin01 history error: ', history.reason); + console.log('Vin01 base error: ', base.reason.message); + console.log('Vin01 history error: ', history.reason.message); let vehicle = new Vehicle(); vehicle.vin1 = Utils.cyrillicToLatin(vin); vehicle.debugInfo = {