lib/gris/grape_extensions/error_helpers.rb in gris-0.5.2 vs lib/gris/grape_extensions/error_helpers.rb in gris-0.5.3
- old
+ new
@@ -1,9 +1,9 @@
module Gris
module ErrorHelpers
- def error!(message, status, options = nil)
- message = { error: message }.merge(options.is_a?(String) ? { text: options } : options) if options
- throw :error, message: message, status: status
+ def gris_error!(message, status)
+ response = { status: status, message: message }
+ throw :error, message: response, status: status
end
Grape::Endpoint.send :include, self if defined?(Grape)
end
end