lib/grape/dsl/inside_route.rb in grape-2.1.3 vs lib/grape/dsl/inside_route.rb in grape-2.2.0
- old
+ new
@@ -168,10 +168,15 @@
# @param backtrace [Array<String>] The backtrace of the exception that caused the error.
# @param original_exception [Exception] The original exception that caused the error.
def error!(message, status = nil, additional_headers = nil, backtrace = nil, original_exception = nil)
status = self.status(status || namespace_inheritable(:default_error_status))
headers = additional_headers.present? ? header.merge(additional_headers) : header
- throw :error, message: message, status: status, headers: headers, backtrace: backtrace, original_exception: original_exception
+ throw :error,
+ message: message,
+ status: status,
+ headers: headers,
+ backtrace: backtrace,
+ original_exception: original_exception
end
# Creates a Rack response based on the provided message, status, and headers.
# The content type in the headers is set to the default content type unless provided.
# The message is HTML-escaped if the content type is 'text/html'.