Try to show exception information in the test

This commit is contained in:
Lin Jen-Shin 2017-08-10 22:21:22 +08:00
parent c772464b68
commit 8730cd8657

View file

@ -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