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 15, 2018
1 parent 4fb35a7 commit 48e9517
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(cause: ex, message: ex.message)
end
end

Expand Down

0 comments on commit 48e9517

Please sign in to comment.