Exception: Graphiti::Errors::SideloadAssignError

Inherits:
Base
  • Object
show all
Defined in:
lib/graphiti/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource_class, sideload_name) ⇒ SideloadAssignError

Returns a new instance of SideloadAssignError.



281
282
283
284
# File 'lib/graphiti/errors.rb', line 281

def initialize(resource_class, sideload_name)
  @resource_class = resource_class
  @sideload_name = sideload_name
end

Instance Method Details

#messageObject



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/graphiti/errors.rb', line 286

def message
  <<-MSG
    #{@resource_class.name}: error occurred while sideloading "#{@sideload_name}"!

    The error was raised while attempting to assign relevant model instances. Read
    more about sideload assignment here: www.graphiti.dev/guides/concepts/resources#customizing-assignment

    A good way to debug is to put a debugger within the 'assign' block.

    Here's the original, underlying error:

    #{cause.class.name}: #{cause.message}
    #{cause.backtrace.join("\n")}
  MSG
end