class

Honeybadger::Payload

Inherits Reference / Object

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.

Constants

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

Constructors

new(exception : Exception)

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

Source
new(message : String, *, error_class : String | Nil = nil)
Source

Instance methods

context_json(builder)

Renders request context provided by http middleware.

Source
error_class
Source
error_class=(error_class : String | Nil)
Source
error_message
Source
error_message=(error_message : String | Nil)
Source
request_json(builder)

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

Source
set_context(hash_context : Hash) : Nil

Allows manually appending context

Source
to_json(builder : JSON::Builder)

Renders the complete json payload.

Source