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