File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -202,8 +202,17 @@ def _do_request(self, request):
202202 except urllib .error .HTTPError as e :
203203 if e .headers .get ("Content-Type" , "" ) == "application/problem+json" :
204204 info = json .load (e )
205- raise ClientError (info .get ("detail" ))
206- raise ClientError (e .read ().decode ("utf-8" ))
205+ err_detail = info .get ("detail" )
206+ else :
207+ err_detail = e .read ().decode ("utf-8" )
208+
209+ error_msg = (
210+ f"HTTP Error: { e .code } { e .reason } \n "
211+ f"URL: { request .get_full_url ()} \n "
212+ f"Method: { request .get_method ()} \n "
213+ f"Detail: { err_detail } "
214+ )
215+ raise ClientError (error_msg )
207216 except urllib .error .URLError as e :
208217 # e.g. when DNS resolution fails (no internet connection?)
209218 raise ClientError ("Error requesting " + request .full_url + ": " + str (e ))
Original file line number Diff line number Diff line change @@ -620,7 +620,7 @@ def test_available_storage_validation(mc):
620620 mc .push_project (project_dir )
621621 except ClientError as e :
622622 # Expecting "You have reached a data limit" 400 server error msg.
623- assert str ( e ) == "You have reached a data limit"
623+ assert "You have reached a data limit" in str ( e )
624624 got_right_err = True
625625 assert got_right_err
626626
You can’t perform that action at this time.
0 commit comments