Skip to content

Commit

Permalink
set message attributes in ClientError
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein committed Jul 26, 2024
1 parent 0bdc99c commit 94dc79e
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/posit/connect/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ def __init__(
http_message: str,
payload: Any = None,
):
message = {
"error_code": error_code,
"error_message": error_message,
"http_status": http_status,
"http_message": http_message,
"payload": payload,
}
super().__init__(json.dumps(message))
self.error_code = error_code
self.error_message = error_message
self.http_status = http_status
self.http_message = http_message
self.payload = payload
super().__init__(
json.dumps(
{
"error_code": error_code,
"error_message": error_message,
"http_status": http_status,
"http_message": http_message,
"payload": payload,
}
)
)

0 comments on commit 94dc79e

Please sign in to comment.