Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why message argument for OperationalError #83

Closed
bindi-mo opened this issue Jan 20, 2025 · 3 comments
Closed

why message argument for OperationalError #83

bindi-mo opened this issue Jan 20, 2025 · 3 comments

Comments

@bindi-mo
Copy link

line 356 in core.py

    352         caller = logging.getLogger().findCaller()
    353     file_path, line_no, func_name = caller[:3]
    355     raise OperationalError(
    356         message="\n".join(
    357             [
    358                 "failed to execute query at {:s}({:d}) {:s}".format(

empty exception string

>>> err = OperationalError('hoge')
>>> err
''

get string is call message method

>>> err.message
'hoge'

why?

@thombashi
Copy link
Owner

@bindi-mo
I'm not sure what you are asking for.
Are you suggesting that OperationalError class should implement __str__ method?

@bindi-mo
Copy link
Author

yes

>>> err = ValueError('hoge')
>>> str(err)
'hoge'

thombashi added a commit that referenced this issue Mar 1, 2025
@thombashi
Copy link
Owner

I had implemented __str__ method for OperationalError at SimpleSQLite 1.5.4.
Thank you for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants