From e99b894b54fdc3f419c4fd29b8a76a3c09b96a36 Mon Sep 17 00:00:00 2001 From: Selim Mustafaev Date: Fri, 9 Oct 2020 21:38:15 +0300 Subject: [PATCH] Fixed parsing vin01 response --- data_providers/vin01.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data_providers/vin01.js b/data_providers/vin01.js index 5f4afd9..9bb8f91 100644 --- a/data_providers/vin01.js +++ b/data_providers/vin01.js @@ -30,6 +30,12 @@ class Vin01Provider { let json = await result.json(); if(json.status == 200) { + if(json.data.status != 200) { + console.log('Vin01 failed to get GIBDD report with status: ', json.data.status, ', and error: ', json.data.message); + let vehicle = new Vehicle(); + vehicle.vin1 = vin; + return vehicle; + } console.log('vin01 found history'); let vehicle = Vehicle.fromVin01(json.data); vehicle.number = number;