Sha256: b4e6fcd566e0e5ed3149c38502135ffe9b30fa02c60dbd8d97e5ff506ecb5bc9
Contents?: true
Size: 849 Bytes
Versions: 15
Compression:
Stored size: 849 Bytes
Contents
# frozen_string_literal: true module GraphqlRails module Integrations # sentry integration module Sentry require 'active_support/concern' # controller extension which logs errors to sentry module SentryLogger extend ActiveSupport::Concern included do around_action :log_to_sentry protected def log_to_sentry Raven.context.transaction.pop Raven.context.transaction.push "#{self.class}##{action_name}" yield rescue Exception => error # rubocop:disable Lint/RescueException Raven.capture_exception(error) unless error.is_a?(GraphQL::ExecutionError) raise error end end end def self.enable GraphqlRails::Controller.include(SentryLogger) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems