Skip to content

Commit

Permalink
Add more user friendly message to Connection#initialize
Browse files Browse the repository at this point in the history
This adds the cause for the exception as a message to this exception,
making it more clear why this failed.
  • Loading branch information
helaan committed Apr 14, 2018
1 parent 4fb35a7 commit c7c65bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mysql/connection.cr
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class MySql::Connection < DB::Connection
read_ok_or_err do |packet, status|
raise "packet #{status} not implemented"
end
rescue Errno
raise DB::ConnectionRefused.new
rescue ex : Errno
raise DB::ConnectionRefused.new(ex.message)
end
end

Expand Down

0 comments on commit c7c65bf

Please sign in to comment.