Exception: SidekiqUniqueJobs::InvalidUniqueArguments

Inherits:
UniqueJobsError
  • Object
show all
Defined in:
lib/sidekiq_unique_jobs/exceptions.rb

Overview

Error raised when a Lua script fails to execute

Author:

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ InvalidUniqueArguments

Returns a new instance of InvalidUniqueArguments.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/sidekiq_unique_jobs/exceptions.rb', line 73

def initialize(options)
  given            = options[:given]
  job_class        = options[:job_class]
  lock_args_method = options[:lock_args_method]
  lock_args_meth   = job_class.method(lock_args_method)
  num_args         = lock_args_meth.arity
  source_location  = lock_args_meth.source_location

  super(
    "#{job_class}##{lock_args_method} takes #{num_args} arguments, received #{given.inspect}" \
    "\n\n" \
    "   #{source_location.join(':')}"
  )
end