playov2-js-utilities 0.3.55 → 0.3.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,7 +30,7 @@ const playoResponseHandler = (resp, requestId) => {
|
|
|
30
30
|
response = { data: { requestStatus: 0 } }
|
|
31
31
|
} = resp;
|
|
32
32
|
const { url } = config;
|
|
33
|
-
const { data = { requestStatus: 0, statusError: "POTENTIAL-BAD-GATEWAY" }} = response;
|
|
33
|
+
const { data = { requestStatus: 0, statusError: "POTENTIAL-BAD-GATEWAY" } } = response;
|
|
34
34
|
data["message"] = message;
|
|
35
35
|
Logger.prepareErrorLog(requestId, { code, message }, `Api call to url to ${url} failed`)
|
|
36
36
|
throw (data);
|
|
@@ -47,6 +47,11 @@ const playoResponseHandler = (resp, requestId) => {
|
|
|
47
47
|
return data
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
if(status >= 400) {
|
|
51
|
+
Logger.prepareErrorLog(requestId, { code, message }, `Api call to url to ${url} failed`)
|
|
52
|
+
throw (data);
|
|
53
|
+
}
|
|
54
|
+
|
|
50
55
|
else { // ideally this should not get triggered unless there is fault in calling lib itself
|
|
51
56
|
Logger.prepareErrorLog(requestId, { response: resp }, "axios error");
|
|
52
57
|
throw ({ requestStatus: 0, message: "Failed to handle response" })
|