Skip to content

Commit

Permalink
Fix server-side validation errors in IP allowlist CLI being swallowed. (
Browse files Browse the repository at this point in the history
  • Loading branch information
collincchoy authored Aug 29, 2024
1 parent ab1b56a commit 63303b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/prefect/cli/cloud/ip_allowlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ def _print_ip_allowlist_table(ip_allowlist: IPAllowlist, enabled: bool):

def _handle_update_error(error: PrefectHTTPStatusError):
if error.response.status_code == 422 and (
details := error.response.json().get("detail")
details := (
error.response.json().get("detail")
or error.response.json().get("exception_detail")
)
):
exit_with_error(f"Error updating allowlist: {details}")
else:
raise error

0 comments on commit 63303b4

Please sign in to comment.