crystal-mysql
crystal-mysql copied to clipboard
Add more user friendly message to Connection#initialize
This adds the cause for the exception as a message to this exception, making it more clear why this failed.
This saves a lot of debugging time when you have an issue with your database connection. As this is the first thing new users will do with this library, it is important to give users feedback on why this failed.
To be honest, DB
should probably not expose DB::ConnectionRefused
at all, and just re-raise the cause
exception when it catches DB::ConnectionRefused
, prefixed with a message.