fluke/devops-service/exceptions/invalid_record.rb
2015-11-02 17:33:25 +03:00

24 lines
339 B
Ruby

require_relative "devops_error"
class InvalidRecord < ::Devops::Exception::DevopsError
def initialize msg
if msg.is_a?(String)
super(msg)
else
@object = msg
end
end
def http_status
400
end
def http_body
if @object.nil?
super
else
JSON.pretty_generate(@object)
end
end
end