The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::API::CPAN::Exception - Meta CPAN API Exception

SYNOPSIS

    use Net::API::CPAN::Exception;
    my $this = Net::API::CPAN::Exception->new(
        code => 500,
        message => $error_message,
    );
    die( $this );

    my $ex = Net::API::CPAN::Exception->new({
       code => 404,
       type => $error_type,
       file => '/home/joe/some/lib/Net/API/CPAN/Author.pm',
       line => 114,
       message => 'Invalid property provided',
       package => 'Net::API::CPAN::Author',
       subroutine => 'cpanid',
       # Some optional discretionary metadata hash reference
       cause =>
           {
           object => $some_object,
           payload => $json_data,
           },
    });
    print( "Error stack trace: ", $ex->stack_trace, "\n" );
    # or
    $author->updated( $bad_datetime ) || 
        die( "Error in file ", $author->error->file, " at line ", $author->error->line, "\n" );
    # or simply:
    $author->customer_orders || 
        die( "Error: ", $author->error, "\n" );
    $ex->cause->payload;

VERSION

    v0.1.0

DESCRIPTION

This class inherits all its methods from Module::Generic::Exception

METHODS

Plese see Module::Generic::Exception for details.

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Module::Generic::Exception

COPYRIGHT & LICENSE

Copyright(c) 2023 DEGUEST Pte. Ltd.

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.