7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/spice/response/client_error.rb', line 7
def on_complete(env)
case env[:status].to_i
when 400
raise Spice::Error::BadRequest.new(error(env[:body]), env[:request_headers])
when 401
raise Spice::Error::Unauthorized.new(error(env[:body]), env[:request_headers])
when 403
raise Spice::Error::Forbidden.new(error(env[:body]), env[:request_headers])
when 404
raise Spice::Error::NotFound.new(error(env[:body]), env[:request_headers])
when 406
raise Spice::Error::NotAcceptable.new(error(env[:body]), env[:request_headers])
when 409
raise Spice::Error::Conflict.new(error(env[:body]), env[:request_headers])
end
end
|