Skip to content
Snippets Groups Projects
Commit cc47641f authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Set status 500 response when an exception was caught

parent 5214ee81
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ class V1::SearchController < ApplicationController ...@@ -11,6 +11,7 @@ class V1::SearchController < ApplicationController
if e.message == "Invalid search" if e.message == "Invalid search"
render json: @search.errors, status: :bad_request render json: @search.errors, status: :bad_request
else else
render nothing: true, status: :internal_server_error
puts e.message puts e.message
puts e.backtrace puts e.backtrace
end end
...@@ -26,6 +27,7 @@ class V1::SearchController < ApplicationController ...@@ -26,6 +27,7 @@ class V1::SearchController < ApplicationController
if e.message == "Invalid search" if e.message == "Invalid search"
render json: @search.errors, status: :bad_request render json: @search.errors, status: :bad_request
else else
render nothing: true, status: :internal_server_error
puts e.message puts e.message
puts e.backtrace puts e.backtrace
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment