Exception: Postburner::Job::BadFormat

Inherits:
StandardError
  • Object
show all
Defined in:
app/models/postburner/job.rb

Overview

Note:

The error message includes full job parameters for debugging

Note:

Access original Beanstalkd error via exception.cause

Exception raised when Beanstalkd rejects a job with BAD_FORMAT error.

Beanstalkd returns BAD_FORMAT when job parameters are invalid, such as:

  • Negative delay values

  • Invalid priority (outside 0-4294967295 range)

  • Invalid TTR (time-to-run)

  • Malformed job data

This exception wraps the original Beaneater::BadFormatError and includes detailed debugging information about the parameters that caused the error. The original exception is preserved via the ‘cause` chain.

Examples:

Common causes

# Negative delay (now prevented by fix in queue.rb)
job.queue!(at: 1.hour.ago)  # Previously caused BAD_FORMAT

# Invalid priority
job.queue!(pri: -1)  # Outside valid range

Accessing detailed error information

begin
  job.queue!(at: past_time)
rescue Postburner::Job::BadFormat => e
  puts e.message  # Includes tube, data, pri, delay, ttr
  puts e.cause    # Original Beaneater::BadFormatError
end

See Also:

  • Queue#insert