test-airbrake 659 Bytes
Newer Older
Andrew Lee's avatar
Andrew Lee committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
#!/usr/bin/env perl

use strict;
use warnings;
use FindBin;
use UUID qw/uuid/;
use Data::Dumper;
BEGIN {
  push @INC, "$FindBin::Bin/../src/backend";
};

use BSAirBrake;

BSUtil::setdebuglevel(7);

raise();

exit 0;

sub raise {

  my $ab = BSAirBrake->new(
    api_key    => $::ENV{ERRBIT_API_KEY},
    base_url   => $::ENV{ERRBIT_BASE_URL},
    project_id => 1
  );

  my $error     = "Hello World from BSAirBrake";
  my $options   = {
     environment => { SCRIPT => $0 },
     session     => { "session-id" => uuid() },
     params      => { 'param1' => 'value1' },
  };

  my $backtrace =1;

  print Dumper($ab->notify($error, $options, $backtrace));

}