Skip to content

Commit

Permalink
Merge pull request #410 from atlanhq/DVX-723
Browse files Browse the repository at this point in the history
 DVX-723: Fixed `AtlanError` message for unescaped curly braces in `response.text`
  • Loading branch information
Aryamanz29 authored Oct 23, 2024
2 parents ade5e93 + f9487bf commit d72b273
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyatlan/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AtlanError(Exception):
def __init__(self, error_code: ErrorInfo, *args):
try:
message = error_code.error_message.format(*args)
except KeyError:
except (KeyError, ValueError):
message = error_code.error_message
super().__init__(message)
self.error_code = error_code
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,7 @@ def test_user_client_methods_validation_error(client, method, params):
"{'error': 123, 'code': 465}",
"{'error': 123} with text",
"Some error message...",
"With unescape curly braces -> {'{}'}",
],
)
@patch.object(AtlanClient, "_session")
Expand Down

0 comments on commit d72b273

Please sign in to comment.