Skip to content

Commit

Permalink
feat: print out helpful error message for 403
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Aug 5, 2020
1 parent 573e97c commit 5d5a18a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/pact_broker/client/base_client.rb
Expand Up @@ -69,6 +69,12 @@ def handle_response response
yield response
elsif response.code == 404
nil
elsif response.code == 403
message = "Authorization failed (insufficient permissions)"
if response.body && response.body.size > 0
message = message + ": #{response.body}"
end
raise Error.new(message)
elsif response.code == 401
message = "Authentication failed"
if response.body && response.body.size > 0
Expand Down

0 comments on commit 5d5a18a

Please sign in to comment.