Fix dbapi error to comply with pep#320
Conversation
|
It changes the native and http and asynch. |
| You can use this to catch all errors with one single except statement. | ||
| """ | ||
| pass | ||
| Error = DatabaseException |
There was a problem hiding this comment.
Why do we change Exception to DatabaseException? Ordinary exceptions can be thrown as well.
There was a problem hiding this comment.
I'm just a little confused about what DatabaseException does.
If the ordinary exceptions is also thrown, then it should be Exception or clickhouse_driver.Error?
|
Updated. This does not mean "catch all exceptions". This creates a new exception called "Error", but no one will ever try to raise it. |
|
If you agree to this change, I will write a unittest ASAP. |
|
It's better to write from asynch.errors import ClickHouseException
...
Error = ClickHouseExceptionYes, please write a test for this fix. |
1b89131 to
4804e76
Compare
|
Test added, sorry for the wait. |
Checklist:
flake8and fix issues.pytestno tests failed. See https://clickhouse-sqlalchemy.readthedocs.io/en/latest/development.html.