JSON-API-Error

 view release on metacpan or  search on metacpan

lib/JSON/API/Error.pm  view on Meta::CPAN

use Moo;
use overload bool => sub {1}, '""' => \&to_string;

use Types::Standard qw/Str HashRef/;

our $VERSION = '0.01';

has code   => (is => 'ro', isa => Str);
has detail => (is => 'ro', isa => Str);
has id     => (is => 'ro', isa => Str);
has links  => (is => 'ro', isa => HashRef);
has meta   => (is => 'ro', isa => HashRef);
has source => (is => 'ro', isa => HashRef);
has status => (is => 'ro', isa => Str);
has title  => (is => 'ro', isa => Str);

sub to_string {
    my $self = shift;
    return sprintf "%s: %s", $self->{source}->{pointer}, $self->{title};
}

sub TO_JSON {
    my $self = shift;



( run in 0.743 second using v1.01-cache-2.11-cpan-5f2e87ce722 )