Skip to content

Commit

Permalink
Right error handling in calls
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Nov 29, 2024
1 parent fc160f7 commit 3b153da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,13 +588,14 @@ def call_jenkins_build(job_name: str,
headers=build_credentials_header(auth_input_arg))
# 201 code is "created", it is the expected return of POST
if response.status != 201:
error(f"Error {response.status}: {response.reason}")
http.clear()
error(f"{response.status}: {response.reason}")
except RequestError as e:
http.clear()
error(f"An error occurred in the http request: {e}")
except Exception as e:
error(f"An unexpected error occurred: {e}")
finally:
http.clear()
error(f"An unexpected error occurred: {e}")


def display_help_job_chain_for_source_calls(args):
Expand Down

0 comments on commit 3b153da

Please sign in to comment.