Skip to content

Commit

Permalink
Loosen response header check for RequestError
Browse files Browse the repository at this point in the history
  • Loading branch information
mattantonelli committed Sep 26, 2018
1 parent 4130f8d commit 0571b54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xivapi/exceptions.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module XIVAPI
class RequestError < StandardError
def initialize(response)
if response.headers[:content_type] == 'application/problem+json'
if response.headers[:content_type] =~ /json/
message = JSON.parse(response)['Message']
else
message = 'Error contacting the API.'
Expand Down

0 comments on commit 0571b54

Please sign in to comment.