Skip to content

Commit ddabc71

Browse files
committed
Broaden error detail environments
Normally `consider_all_requests_local` is setup for development type environments. In these environments we want to get as much information about our problems as we can. By separating this check from the status code check we can be sure we get the information we need when developing new routes, actions, views, etc. Interestingly, the test environment does not consider the requests local by default. We do not make an exception because it allows tests to verify the actual returned responses as a client would see them. `500 Internal Server` errors are conditions we do not expect. If this happens during a test we want to ensure we have all the information we need to properly diagnose the issue.
1 parent 2d06f42 commit ddabc71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/kracken/json_api/public_exceptions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def additional_details(error)
2727

2828
def show_error_details?(wrapper)
2929
wrapper.is_details_exception? ||
30-
( Rails.application.config.consider_all_requests_local &&
31-
wrapper.status_code == 500)
30+
Rails.application.config.consider_all_requests_local ||
31+
(Rails.env.test? && wrapper.status_code == 500)
3232
end
3333

3434
def error_as_json(wrapper)

0 commit comments

Comments
 (0)