File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
src/implementation/Client/HTTPClient Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -203,27 +203,17 @@ export default class HTTPClient implements IClient {
203
203
if ( res . status >= 200 && res . status <= 399 ) {
204
204
return txtParsed ;
205
205
}
206
- // 400 = Bad Request, 401 = Unauthorized, 404 = Not Found
207
- else if ( res . status === 400 || res . status === 401 || res . status === 404 ) {
208
- throw new Error ( JSON . stringify ( txtParsed ) ) ;
209
- }
210
- // 403 = Forbidden
211
- else if ( res . status === 403 ) {
212
- throw new Error ( JSON . stringify ( txtParsed ) ) ;
213
- }
214
- // 500 = Internal Server Error, 502 = Bad Gateway
215
- else if ( res . status === 500 || res . status === 502 ) {
216
- throw new Error ( JSON . stringify ( txtParsed ) ) ;
217
- }
206
+
218
207
// All the others
219
208
else {
220
- this . logger . debug ( " Execute response text: %s" , txtParsed ) ;
209
+ this . logger . debug ( ` Execute response with status: ${ res . status } and text: ${ txtParsed } ` ) ;
221
210
throw new Error (
222
211
JSON . stringify ( {
223
212
error : "UNKNOWN" ,
224
- error_msg : `An unknown problem occured and we got the status ${ res . status } with response ${ JSON . stringify (
213
+ error_msg : `An unknown problem occurred and we got the status ${ res . status } with response ${ JSON . stringify (
225
214
res ,
226
215
) } `,
216
+ status : res . status ,
227
217
} ) ,
228
218
) ;
229
219
}
You can’t perform that action at this time.
0 commit comments