Skip to content

Commit

Permalink
add exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Betz committed Oct 6, 2020
1 parent cafe111 commit 3ead78e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/pg/connection_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require "../spec_helper"

describe PG::Connection, "#initialize" do
it "raises on bad connections" do
expect_raises(DB::ConnectionRefused) {
expect_raises(DB::ConnectionRefused, "Cannot establish connection") {
DB.open("postgres://localhost:5433")
}
end
Expand Down
2 changes: 1 addition & 1 deletion src/pg/connection.cr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module PG
@connection = PQ::Connection.new(conn_info)
@connection.connect
rescue ex
raise DB::ConnectionRefused.new(cause: ex)
raise DB::ConnectionRefused.new(ex.message, cause: ex)
end
end

Expand Down

0 comments on commit 3ead78e

Please sign in to comment.