class Graphiti::Errors::RecordNotFound

Public Class Methods

new(resource = nil, id = nil, path = nil) click to toggle source
# File lib/graphiti/errors.rb, line 775
def initialize(resource = nil, id = nil, path = nil)
  @resource = resource
  @id = id
  @path = path
end

Public Instance Methods

message() click to toggle source
# File lib/graphiti/errors.rb, line 781
def message
  if !@resource.nil? && !@id.nil?
    "The referenced resource '#{@resource}' with id '#{@id}' could not be found.".tap do |msg|
      msg << " Referenced at '#{@path}'" unless @path.nil?
    end
  else
    "Specified Record Not Found"
  end
end