diff options
Diffstat (limited to 'activeresource/lib')
-rw-r--r-- | activeresource/lib/active_resource/connection.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb index 132e861292..21573a34cb 100644 --- a/activeresource/lib/active_resource/connection.rb +++ b/activeresource/lib/active_resource/connection.rb @@ -17,14 +17,12 @@ module ActiveResource end end - class ClientError < ConnectionError - end + class ClientError < ConnectionError; end # 4xx Client Error + class ResourceNotFound < ClientError; end # 404 Not Found + class ResourceConflict < ClientError; end # 409 Conflict - class ServerError < ConnectionError - end + class ServerError < ConnectionError; end # 5xx Server Error - class ResourceNotFound < ClientError - end class Connection attr_accessor :site @@ -73,6 +71,8 @@ module ActiveResource raise(ResourceNotFound.new(response)) when 400 raise(ResourceInvalid.new(response)) + when 409 + raise(ResourceConflict.new(response)) when 401...500 raise(ClientError.new(response)) when 500...600 |