You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the message attribute can be None therefore there needs to be a check/cast prior to returning.
Note: message_with_context will also fail when a message is None since you can't use the operand type + for NoneType and a str
classError(Exception):
"""Base class for DB-API2.0 exceptions. `message`: An optional user-friendly error message. It should be short, actionable and stable `context`: Optional extra context about the error. MUST be JSON serializable """def__init__(self, message=None, context=None, *args, **kwargs):
super().__init__(message, *args, **kwargs)
self.message=messageself.context=contextor {}
def__str__(self):
returnself.messagedefmessage_with_context(self):
returnself.message+": "+json.dumps(self.context, default=str)
@chidifrank thank you for reporting this! May I ask you to share a stacktrace for this error so I can understand where it comes from? None of that errors should be raised without a message, so your case indicates that something is wrong elsewhere
Thank you! Yeah, looks that it is initialized with the error message from server, but it actually may be empty. We need additional check there, as well as a reasonable fallback (probably)
Activity
kravets-levko commentedon Sep 10, 2024
@chidifrank thank you for reporting this! May I ask you to share a stacktrace for this error so I can understand where it comes from? None of that errors should be raised without a message, so your case indicates that something is wrong elsewhere
chidifrank commentedon Sep 10, 2024
@kravets-levko
Sure!
kravets-levko commentedon Sep 10, 2024
Thank you! Yeah, looks that it is initialized with the error message from server, but it actually may be empty. We need additional check there, as well as a reasonable fallback (probably)
chidifrank commentedon Sep 10, 2024
Thanks for the effort! @kravets-levko
peco-engineer-bot commentedon Jul 23, 2026
🤖 engineer-bot opened a fix PR: #875
Review before merge.