There's a todo for deprecation (it's been a while) but there's no warn DEPRECATION. Since it's use internally, adding a warning will pop every single time.
I think we should not use it internally and add a proper warning DEPRECATION. What do you think ?
|
# TODO: This method is deprecated. Refactor out. |
|
def error_response(error = {}) |
|
status = error[:status] || options[:default_status] |
|
message = error[:message] || options[:default_message] |
|
headers = { Grape::Http::Headers::CONTENT_TYPE => content_type } |
|
headers.merge!(error[:headers]) if error[:headers].is_a?(Hash) |
|
backtrace = error[:backtrace] || error[:original_exception]&.backtrace || [] |
|
original_exception = error.is_a?(Exception) ? error : error[:original_exception] || nil |
|
rack_response(format_message(message, backtrace, original_exception), status, headers) |
|
end |
There's a
todofordeprecation(it's been a while) but there's no warn DEPRECATION. Since it's use internally, adding a warning will pop every single time.I think we should not use it internally and add a proper warning DEPRECATION. What do you think ?
grape/lib/grape/middleware/error.rb
Lines 62 to 71 in 0fa5216