Skip to content

Commit a16becb

Browse files
committed
use ex.http_status if exist
1 parent 771c3ec commit a16becb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/restful_error/exceptions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def self.controller_path = "restful_error"
77

88
def show
99
@exception = request.env["action_dispatch.exception"]
10-
code = request.path_info[1..].to_i
10+
code = @exception.try(:http_status) || request.path_info[1..].to_i
1111
status = RestfulError.build_status_from_symbol_or_code(code)
1212
@status_code = status.code
1313
@reason_phrase = status.reason_phrase

0 commit comments

Comments
 (0)