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
Catch clause is not understood #902
Comments
Everything happens for a reason, in this case a missing class: |
#904 was merged, closing here. |
while it's not directly related to the change, still sometimes confusing, because IMO, maybe in general makes no sense to catch it? from trace will be clear when it has happened and from message will be clear why |
@OleksiiChernomaz but that message is still meaningful: in general, you don't want your connection to be established just to get the database platform (as that would require having access to the DB server during the time you warm up your metadata cache of the ORM, which might not be the case). If your credentials are indeed wrong (a user not having access to the DB, rather than just not having access during the cache warmup), then you will get an exception later when trying to connect to the DB server for a legitimate reason. |
while i agree that there is quite understandable logic in having message like "Occurred exception on attempt to figure out your platform version" on the other side sometimes it's confusing when you hit this error first time because IMO, it become understandable after you've already faced an issue and have seen this code. Thats why practically simpler when exception is not caught and bubbles up as not all the time previous exceptions are logged correctly, and based on the exception will be quite clear what has happened and from which piece of code it was triggered. E.g i usually (probably as many other users as well) try to allow app to resolve version automatically to have less config options related to infra "hardcoded" on the app layer, thats why did not define on intend server_version and did not make it parametrised (because it will be an overkill). In my case error was because of the misconfigured DB server :) |
The catch clause in the ConnectionFactory is poorly understood.
Catch the DriverException directly istead.
The text was updated successfully, but these errors were encountered: