Class: River::AttemptError

Inherits:
Object
  • Object
show all
Defined in:
lib/job.rb

Overview

A failed job work attempt containing information about the error or panic that occurred.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(at:, attempt:, error:, trace:) ⇒ AttemptError

Returns a new instance of AttemptError.



181
182
183
184
185
186
187
188
189
190
191
# File 'lib/job.rb', line 181

def initialize(
  at:,
  attempt:,
  error:,
  trace:
)
  self.at = at
  self.attempt = attempt
  self.error = error
  self.trace = trace
end

Instance Attribute Details

#atObject

The time at which the error occurred.



167
168
169
# File 'lib/job.rb', line 167

def at
  @at
end

#attemptObject

The attempt number on which the error occurred (maps to #attempt on a job row).



171
172
173
# File 'lib/job.rb', line 171

def attempt
  @attempt
end

#errorObject

Contains the stringified error of an error returned from a job or a panic value in case of a panic.



175
176
177
# File 'lib/job.rb', line 175

def error
  @error
end

#traceObject

Contains a stack trace from a job that panicked. The trace is produced by invoking ‘debug.Trace()` in Go.



179
180
181
# File 'lib/job.rb', line 179

def trace
  @trace
end