struct Azu::ErrorContext

Overview

Enhanced error context for better debugging

Defined in:

azu/error.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(timestamp : Time = Time.utc, request_id : Nil | String = nil, user_id : Nil | String = nil, session_id : Nil | String = nil, ip_address : Nil | String = nil, user_agent : Nil | String = nil, referer : Nil | String = nil, endpoint : Nil | String = nil, method : Nil | String = nil, params : Nil | Hash(String, String) = nil, headers : HTTP::Headers | Nil = nil, _load_environment : Bool = false) #

[View source]

Class Method Detail

def self.from_http_context(context : HTTP::Server::Context, request_id : String | Nil = nil, load_environment : Bool = true) #

[View source]
def self.lightweight_from_http_context(context : HTTP::Server::Context, request_id : String | Nil = nil) #

Create a lightweight context without environment data


[View source]

Instance Method Detail

def endpoint : String | Nil #

[View source]
def environment : Hash(String, String) | Nil #

Lazy getter for environment data


[View source]
def headers : HTTP::Headers | Nil #

[View source]
def ip_address : String | Nil #

[View source]
def method : String | Nil #

[View source]
def params : Hash(String, String) | Nil #

[View source]
def referer : String | Nil #

[View source]
def request_id : String | Nil #

[View source]
def session_id : String | Nil #

[View source]
def timestamp : Time #

[View source]
def to_h #

[View source]
def to_json(json : JSON::Builder) #

[View source]
def user_agent : String | Nil #

[View source]
def user_id : String | Nil #

[View source]