class
JoobQ::ErrorContext
- JoobQ::ErrorContext
- Reference
- Object
Overview
Comprehensive error context system for better error handling and debugging
Included Modules
Defined in:
joobq/error_context.crConstructors
- .from_exception(job : Job, queue : BaseQueue, exception : Exception, worker_id : String, retry_count : Int32 = 0, additional_context : Hash(String, String) = {} of String => String) : ErrorContext
- .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)
- .new(pull : JSON::PullParser)
Class Method Summary
- .build_system_context(queue : BaseQueue, additional : Hash(String, String)) : Hash(String, String)
- .classify_error(exception : Exception) : String
- .extract_backtrace(exception : Exception) : Array(String)
- .get_hostname : String
- .get_memory_usage : String
Instance Method Summary
- #backtrace : Array(String)
- #error_cause : String | Nil
- #error_class : String
- #error_message : String
- #error_type : String
- #job_data : String | Nil
- #job_id : String
- #job_type : String
- #occurred_at : String
- #queue_name : String
- #retry_count : Int32
- #retry_delay : Time::Span
- #severity : String
- #should_retry? : Bool
- #system_context : Hash(String, String)
- #to_log_context : Hash(Symbol, String)
- #worker_id : String
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
#
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)
#
Class Method Detail
def self.build_system_context(queue : BaseQueue, additional : Hash(String, String)) : Hash(String, String)
#