Rescue all exceptions in production

This commit is contained in:
Alberto Miedes Garcés
2017-01-27 14:46:26 +01:00
parent 6b47ce065f
commit fd240b2fc7

View File

@@ -14,6 +14,8 @@ class GraphqlController < ApplicationController
render json: { message: 'Query string not present' }, status: :bad_request render json: { message: 'Query string not present' }, status: :bad_request
rescue GraphQL::ParseError rescue GraphQL::ParseError
render json: { message: 'Query string is not valid JSON' }, status: :bad_request render json: { message: 'Query string is not valid JSON' }, status: :bad_request
rescue
unless Rails.env.production? then raise end
end end
end end