Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Register RaiseError Middleware Under Non-Conflicting Name #20

Merged
merged 1 commit into from
Jan 31, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/desk_api/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def middleware
builder.request :retry

builder.response :dates
builder.response :raise_error, DeskApi::Error::ClientError
builder.response :raise_error, DeskApi::Error::ServerError
builder.response :raise_desk_error, DeskApi::Error::ClientError
builder.response :raise_desk_error, DeskApi::Error::ServerError
builder.response :json, content_type: /application\/json/

builder.adapter Faraday.default_adapter
Expand Down
2 changes: 1 addition & 1 deletion lib/desk_api/response/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ def initialize(app, klass)
end
end

Faraday.register_middleware :response, raise_error: lambda { RaiseError}
Faraday.register_middleware :response, :raise_desk_error => lambda { RaiseError}
end
end