vendored/puppet/lib/puppet/rest/response.rb in bolt-0.21.1 vs vendored/puppet/lib/puppet/rest/response.rb in bolt-0.21.2
- old
+ new
@@ -23,7 +23,12 @@
end
def ok?
@message.ok?
end
+
+ def to_exception
+ message = _("Error %{code} on SERVER: %{returned_message}") % { code: status_code, returned_message: body }
+ Puppet::Rest::ResponseError.new(message, self)
+ end
end
end