Skip to content

Commit 78cd862

Browse files
committed
Merge branch 'master' of github.com:adcloud/api-client-ruby
2 parents b3dff83 + 21fbecd commit 78cd862

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

lib/adcloud.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module Adcloud
3333
autoload :WebhookEvent, "adcloud/webhook_event"
3434

3535
module AdcloudUnknownAPIError; class InvalidApiResponse < StandardError; end; end
36+
class UnknownError < ApiError; end
3637
class BadRequestError < ApiError; end
3738
class NotFoundError < ApiError; end
3839
class ServerError < ApiError; end

lib/adcloud/api_error.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ def status
2828
self.meta["status"]
2929
end
3030

31+
def to_s
32+
self.response.message
33+
end
34+
3135
end
3236

3337
end

lib/adcloud/exception_raiser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(response)
1515
when 500
1616
raise Adcloud::ServerError.new(response)
1717
else
18-
raise StandardError.new("Could not handle status #{response.status}")
18+
raise Adcloud::UnknownError.new(response)
1919
end
2020
end
2121

0 commit comments

Comments
 (0)