diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-08-10 22:21:22 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-08-10 22:21:22 +0800 |
commit | 8730cd86570cefa6e964373dff0c2e22013d38fb (patch) | |
tree | be4bb7d785f8f9d498e6366c02c3cd0bd8a834be | |
parent | c772464b68ad87860206e1ad341cca69e301a483 (diff) | |
download | gitlab-ce-8730cd86570cefa6e964373dff0c2e22013d38fb.tar.gz |
Try to show exception information in the test
-rw-r--r-- | lib/api/helpers.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 99b8b62691f..3582ed81b0f 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -257,7 +257,15 @@ module API message << " " << trace.join("\n ") API.logger.add Logger::FATAL, message - rack_response({ 'message' => '500 Internal Server Error' }.to_json, 500) + + response_message = + if Rails.env.test? + message + else + '500 Internal Server Error' + end + + rack_response({ 'message' => response_message }.to_json, 500) end # project helpers |