Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-08-11 15:50:35 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-08-11 15:50:35 +0300
commit4f0fa13eb85994b747c1eb253e346b76b98b5c5b (patch)
treef690c9013ce1653272d0a345cb4840a7e6336ec0 /lib/api/helpers.rb
parentc62ae6cfd70d518386fdbcb9714d18ac4f5e8c31 (diff)
Show error message for API 500 error in tests, and
document have_gitlab_http_status
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb10
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