Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (25 sloc) 0.673 kB
package Tatsumaki::Error;
use strict;
use Any::Moose;
sub throw {
my($class, @rest) = @_;
die $class->new(@rest);
}
package Tatsumaki::Error::ClientDisconnect;
use Any::Moose;
extends 'Tatsumaki::Error';
package Tatsumaki::Error::HTTP;
use Any::Moose;
use HTTP::Status;
extends 'Tatsumaki::Error';
use overload q("") => sub { $_[0]->message }, fallback => 1;
has code => (is => 'rw', isa => 'Int');
has message => (is => 'rw', isa => 'Str');
around BUILDARGS => sub {
my $orig = shift;
my($class, $code, $msg) = @_;
$msg ||= HTTP::Status::status_message($code);
$class->$orig(code => $code, message => $msg);
};
package Tatsumaki::Error;
1;
Jump to Line
Something went wrong with that request. Please try again.