Skip to content

Commit c7c65bf

Browse files
committed
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.
1 parent 4fb35a7 commit c7c65bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mysql/connection.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class MySql::Connection < DB::Connection
2828
read_ok_or_err do |packet, status|
2929
raise "packet #{status} not implemented"
3030
end
31-
rescue Errno
32-
raise DB::ConnectionRefused.new
31+
rescue ex : Errno
32+
raise DB::ConnectionRefused.new(ex.message)
3333
end
3434
end
3535

0 commit comments

Comments
 (0)