crystal-mysql icon indicating copy to clipboard operation
crystal-mysql copied to clipboard

Add more user friendly message to Connection#initialize

Open helaan opened this issue 6 years ago • 1 comments

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.

helaan avatar Apr 14 '18 08:04 helaan

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.

RX14 avatar Apr 15 '18 12:04 RX14