class JoobQ::ErrorContext

Overview

Comprehensive error context system for better error handling and debugging

Included Modules

Defined in:

joobq/error_context.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.from_exception(job : Job, queue : BaseQueue, exception : Exception, worker_id : String, retry_count : Int32 = 0, additional_context : Hash(String, String) = {} of String => String) : ErrorContext #

[View source]
def self.new(job_id : String, queue_name : String, worker_id : String, job_type : String, error_type : String, error_message : String, error_class : String, backtrace : Array(String), retry_count : Int32 = 0, job_data : String | Nil = nil, error_cause : String | Nil = nil, system_context : Hash(String, String) = {} of String => String, occurred_at : String = Time.local.to_rfc3339) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Class Method Detail

def self.build_system_context(queue : BaseQueue, additional : Hash(String, String)) : Hash(String, String) #

[View source]
def self.classify_error(exception : Exception) : String #

[View source]
def self.extract_backtrace(exception : Exception) : Array(String) #

[View source]
def self.get_hostname : String #

[View source]
def self.get_memory_usage : String #

[View source]

Instance Method Detail

def backtrace : Array(String) #

[View source]
def error_cause : String | Nil #

[View source]
def error_class : String #

[View source]
def error_message : String #

[View source]
def error_type : String #

[View source]
def job_data : String | Nil #

[View source]
def job_id : String #

[View source]
def job_type : String #

[View source]
def occurred_at : String #

[View source]
def queue_name : String #

[View source]
def retry_count : Int32 #

[View source]
def retry_delay : Time::Span #

[View source]
def severity : String #

[View source]
def should_retry? : Bool #

[View source]
def system_context : Hash(String, String) #

[View source]
def to_log_context : Hash(Symbol, String) #

[View source]
def worker_id : String #

[View source]