The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::Raygun::Message - A message to be sent to raygun.io

SYNOPSIS

  use WebService::Raygun::Message;
  my $message = WebService::Raygun::Message->new(
        occurred_on => '2014-06-27T03:15:10+1300',
        error       => "This is my error!",
        environment => {
            processor_count       => 2,
            cpu                   => 34,
            architecture          => 'x84',
            total_physical_memory => 3
        },
        request => HTTP::Request->new(
            POST => 'https://www.null.com',
            [ 'Content-Type' => 'text/html', ]
        ),
  );

  # test stuff

DESCRIPTION

You generally should not need to create instances of this class

DESCRIPTION

This module assembles a request for raygun.io.

INTERFACE

occurred_on

Time the error occurred. This can be either:

DateTime object
string

Should have format YYYY-mm-ddTHH:MM:SSz.

Must be a valid datetime with timezone offset, eg 2014-06-30T04:30:30+100. Defaults to current time.

error

The error. Can be one of the following:

string

This could be the output of something like croak or die.

An exception object

See WebService::Raygun::Message::Error for a list of supported exception types.

WebService::Raygun::Message::Error

If possible, the other data types are converted to an instance of this class.

user

Accepts any one of the following:

string

A string containing an email (eg. test@test.com).

integer
HASHREF

Key/values should be a subset of the following:

        {
            identifier   => "someidentifier",
            email        => 'test@test.com',
            is_anonymous => 1|0|undef,
            full_name    => 'Firstname Lastname',
            first_name   => 'Firstname',
            uuid         => '783491e1-d4a9-46bc-9fde-9b1dd9ef6c6e'
        }

All the fields are optional, however if uuid is not supplied, one will be generated automatically.

These will all be coerced into an object of type WebService::Raygun::Message::User.

request

A request object. See WebService::Raygun::Message::Request for a list of supported types.

environment

See WebService::Raygun::Message::Environment.

user_custom_data

Some data from the user.

tags

grouping_key

version

machine_name

response_status_code

Default is 200.

client

prepare_raygun

Converts a Perl hash to JSON.

DEPENDENCIES

SEE ALSO

WebService::Raygun::Message::Request
WebService::Raygun::Message::Environment
WebService::Raygun::Message::Error
WebService::Raygun::Message::Error::StackTrace