Skip to content

Commit 61cd18a

Browse files
committed
Align the signature of Grape::DSL#error! method
1 parent 9a551b1 commit 61cd18a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/grape/dsl/inside_route.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,14 @@ def configuration
163163
# end user with the specified message.
164164
#
165165
# @param message [String] The message to display.
166-
# @param status [Integer] the HTTP Status Code. Defaults to default_error_status, 500 if not set.
166+
# @param status [Integer] The HTTP Status Code. Defaults to default_error_status, 500 if not set.
167167
# @param additional_headers [Hash] Addtional headers for the response.
168-
def error!(message, status = nil, additional_headers = nil)
168+
# @param backtrace [Array<String>] The backtrace of the exception caused an error
169+
# @param backtrace [Exception] The exception causes an error
170+
def error!(message, status = nil, additional_headers = nil, backtrace = nil, original_exception = nil)
169171
status = self.status(status || namespace_inheritable(:default_error_status))
170172
headers = additional_headers.present? ? header.merge(additional_headers) : header
171-
throw :error, message: message, status: status, headers: headers
173+
throw :error, message: message, status: status, headers: headers, backtrace: backtrace, original_exception: original_exception
172174
end
173175

174176
# Creates a Rack response based on the provided message, status, and headers.

0 commit comments

Comments
 (0)