Skip to content

Commit

Permalink
fix: Ensure error code is included in message only if not already pre…
Browse files Browse the repository at this point in the history
…sent
  • Loading branch information
seriaati committed Feb 5, 2025
1 parent c0a96fb commit 4e89a7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion genshin/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, response: typing.Mapping[str, typing.Any] = {}, msg: typing.O
self.original = response.get("message", "")
self.msg = msg or self.msg or self.original

if self.retcode:
if self.retcode and f"[{self.retcode}]" not in self.msg:
msg = f"[{self.retcode}] {self.msg}"
else:
msg = self.msg
Expand Down

0 comments on commit 4e89a7a

Please sign in to comment.