Sha256: 6e9304560d0eb5799f85382c41b34bc012bd961fc7483cf735075fb32de11dc9

Contents?: true

Size: 545 Bytes

Versions: 12

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

module GraphqlRails
  # base class which is returned in case something bad happens. Contains all error rendering tructure
  class CustomExecutionError < ExecutionError
    attr_reader :extra_graphql_data

    def self.accepts?(error)
      error.is_a?(Hash) &&
        (error.key?(:message) || error.key?('message'))
    end

    def initialize(message, extra_graphql_data = {})
      super(message)
      @extra_graphql_data = extra_graphql_data.stringify_keys
    end

    def to_h
      super
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
graphql_rails-2.3.0 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-2.2.0 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-2.1.0 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-2.0.0 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-1.2.6 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-1.2.4 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-1.2.3 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-1.2.2 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-1.2.1 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-1.2.0 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-1.1.0 lib/graphql_rails/errors/custom_execution_error.rb
graphql_rails-1.0.0 lib/graphql_rails/errors/custom_execution_error.rb