@cuppet/core 1.0.15 → 1.0.17
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/package.json +1 -1
- package/src/apiFunctions.js +5 -2
package/package.json
CHANGED
package/src/apiFunctions.js
CHANGED
|
@@ -109,7 +109,8 @@ module.exports = {
|
|
|
109
109
|
});
|
|
110
110
|
return this.response;
|
|
111
111
|
} catch (error) {
|
|
112
|
-
|
|
112
|
+
console.log('Request has failed, use response code step definition to validate the response!');
|
|
113
|
+
return (this.response = error.response);
|
|
113
114
|
}
|
|
114
115
|
},
|
|
115
116
|
|
|
@@ -154,7 +155,9 @@ module.exports = {
|
|
|
154
155
|
*/
|
|
155
156
|
validateResponseCode: async function (code) {
|
|
156
157
|
if (this.response.status !== Number(code)) {
|
|
157
|
-
throw new Error(
|
|
158
|
+
throw new Error(
|
|
159
|
+
`Response code is different than expected, code: ${this.response.status}. Response: ${this.response.data}`
|
|
160
|
+
);
|
|
158
161
|
}
|
|
159
162
|
},
|
|
160
163
|
|