lib/gruf/sentry/server_interceptor.rb
##
# Handle the gruf around hook and capture errors
#
Handle the gruf around hook and capture errors
Handle the gruf around hook and capture errors
def call(&_block)
        return yield if Gruf::Sentry.ignore_methods.include?(request.method_name)
        begin
          yield
        rescue StandardError, GRPC::BadStatus => e
          if error?(e) 
            ::Sentry.configure_scope do |scope|
              scope.set_transaction_name(request.service_key)
              scope.set_tags(grpc_method: request.method_key,
                             grpc_request_class: request.request_class.name,
                             grpc_service_key: request.service_key,
                             grpc_error_code: code_for(e),
                             grpc_error_class: e.class.name)
            end
            ::Sentry.capture_exception(e)
          end
          raise 
        end
      end
def call ( & _block ) return yield if Gruf :: Sentry . ignore_methods . include? ( request . method_name ) begin yield rescue StandardError , GRPC :: BadStatus => e if error? ( e ) :: Sentry . configure_scope do | scope | scope . set_transaction_name ( request . service_key ) scope . set_tags ( grpc_method : request . method_key , grpc_request_class : request . request_class . name , grpc_service_key : request . service_key , grpc_error_code : code_for ( e ) , grpc_error_class : e . class . name ) end :: Sentry . capture_exception ( e ) end raise end end
Handle the gruf around hook and capture errors
Handle the gruf around hook and capture errors
# only capture # passthrough
_block
<not_specific>