class Honeybadger::Payload

Overview

A Payload is a json renderable object which conforms to the honeybadger json schema for exceptions

This payload provides a baseline for general use and is intended to be extended by framework or application specific uses to fill in details.

Direct Known Subclasses

Defined in:

honeybadger/payload.cr

Constant Summary

STACK_FRAME = /^ (?<path>[^:]+) # filename :(?<line>[\d]+) # line number :(?<char>[\d]+) # character offset \sin\s # fixed seperator '(?<method>[^']+)' # method name $/x

Constructors

Instance Method Summary

Constructor Detail

def self.new(exception : Exception) #

Subclasses of Payload can still set @exception, but will likely need to take additional parameters.


[View source]
def self.new(message : String, *, error_class : String | Nil = nil) #

[View source]

Instance Method Detail

def context_json(builder) #

Renders request context provided by http middleware.


[View source]
def error_class : String | Nil #

[View source]
def error_class=(error_class : String | Nil) #

[View source]
def error_message : String | Nil #

[View source]
def error_message=(error_message : String | Nil) #

[View source]
def request_json(builder) #

A basic request object contains just a context object. Override this to embed actual request details.


[View source]
def set_context(hash_context : Hash) : Nil #

Allows manually appending context


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

Renders the complete json payload.


[View source]