Net::A...ler::X(3pm)

πŸ’– Net::Amazon::S3::Error::Handler::X πŸ’–

okay so bestie, welcome to the manual page for Net::Amazon::S3::Error::Handler::X β€” that's a Perl module, section 3pm, straight out of the User Contributed Perl Documentation collection. she's a little error handler and she's so dramatic about it (affectionate). ✨


🌸 NAME 🌸

Net::Amazon::S3::Error::Handler::X β€” Throw error specific exception

like. that's the whole job. she throws exceptions that are specific to the error. no generic sad little string exceptions here, we're doing ✨themed✨ exceptions. πŸ’…


⭐ VERSION ⭐

version 0.992 πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

Raise error specific exception. 🫢

that's it. that's the description. she raises an exception that matches the error. iconic behaviour honestly.

πŸ“ S3 error πŸ“

okay so for S3 errors, the exception she raises is an instance of:

Net::Amazon::S3::X::error-code

so like, the class name literally contains the AWS error code. no cap. 😭

AWS error code list can be found at: <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList>

(not me dropping a whole URL, iykyk β€” go read the list, it's giving thorough.)

and here's how you actually wire her up, fr fr:

my $s3 = Net::Amazon::S3->new (
    error_handler_class => 'Net::Amazon::S3::Error::Handler::X',
    ...
);

eval { do s3 operation; 1 } or do {
    say 'access denied'
        if $@->$Safe::Isa::_isa ('Net::Amazon::S3::X::AccessDenied');
    ...
};

see what's happening there? you pass error_handler_class => 'Net::Amazon::S3::Error::Handler::X' to Net::Amazon::S3->new, and then in your eval you catch the thing with $@ and check $@->$Safe::Isa::_isa ('Net::Amazon::S3::X::AccessDenied') β€” because the exception is an instance of Net::Amazon::S3::X::AccessDenied (that's the error-code slot doing its job πŸ’…). queen behaviour.


πŸ‘‘ AUTHOR πŸ‘‘

Branislav Zahradník <barney@cpan.org> 🌈


This software is copyright (c) 2025 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav ZahradnΓ­k.

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


πŸ’€ reminder bestie: don't skip the license bit, we respect the copyright holders in this house. all six of them. periodt.

and that's the whole page!! πŸŽ€ this one was rendered with perl v5.40.1, dated 2025-12-07, from Net::A...ler::X(3pm), and yes the header said User Contributed Perl Documentation β€” go forth and throw ✨specific✨ exceptions, bestie πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from