Skip to content

Commit

Permalink
Better error message in production. #268
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 15, 2019
1 parent a66dee3 commit e9a223b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/graphql/lupo_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ class LupoSchema < GraphQL::Schema
GraphQL::ExecutionError.new(exception.record.errors.full_messages.join("\n"))
end

# rescue_from StandardError do |exception|
# GraphQL::ExecutionError.new("Please try to execute the query for this field later")
# end
rescue_from StandardError do |exception|
Raven.capture_exception(exception)
message = Rails.env.production? ? "We are sorry, but an error has occured. This problem has been logged and support has been notified. Please try again later. If the error persists please contact support." : exception.message
GraphQL::ExecutionError.new(message)
end

# rescue_from CustomError do |exception, object, arguments, context|
# nil
Expand Down

0 comments on commit e9a223b

Please sign in to comment.