playov2-js-utilities 0.3.8 → 0.3.9
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.
- package/lib/request.js +6 -2
- package/package.json +1 -1
package/lib/request.js
CHANGED
|
@@ -17,10 +17,14 @@ const playoResponseHandler = (resp, requestId) => {
|
|
|
17
17
|
if (status === 200) {
|
|
18
18
|
const { requestStatus } = data;
|
|
19
19
|
LOGGER.info(requestId, data, `Api call to url to ${url} succeeded with status ${status}`);
|
|
20
|
-
|
|
20
|
+
if (!requestStatus) {
|
|
21
|
+
data['requestStatus'] = 1; // assume request status of 1 if any service doesn't provide requestStatus.
|
|
22
|
+
}
|
|
23
|
+
return data;
|
|
21
24
|
} else {
|
|
22
25
|
LOGGER.error(requestId, data, `Api call to url to ${url} failed with status : ${status}`);
|
|
23
|
-
|
|
26
|
+
data['requestStatus'] = 0;
|
|
27
|
+
return Promise.reject(data);
|
|
24
28
|
}
|
|
25
29
|
};
|
|
26
30
|
|