NAME

Net::Async::Zitadel::Error - Structured exception classes for Net::Async::Zitadel

VERSION

version 0.001

SYNOPSIS

use Net::Async::Zitadel::Error;

$z->oidc->verify_token_f($jwt)->then(sub {
    my ($claims) = @_;
    ...
})->catch(sub {
    my ($err) = @_;
    if (ref $err && $err->isa('Net::Async::Zitadel::Error::API')) {
        warn "API error (HTTP " . $err->http_status . "): $err";
    }
    elsif (ref $err && $err->isa('Net::Async::Zitadel::Error::Validation')) {
        warn "Bad argument: $err";
    }
    else {
        Future->fail($err);
    }
});

DESCRIPTION

Three exception classes, all inheriting from Net::Async::Zitadel::Error:

Net::Async::Zitadel::Error::Validation

Missing/invalid arguments, empty issuer/base_url.

Net::Async::Zitadel::Error::Network

OIDC endpoint HTTP failures (discovery, JWKS, userinfo, token).

Net::Async::Zitadel::Error::API

Management API non-2xx responses. Carries http_status and api_message.

All classes stringify to message for backward compatibility.

message

Human-readable error description. The object stringifies to this value, so eval/$@/Future failure string-matching patterns continue to work.

http_status

The HTTP status line returned by the server, e.g. "400 Bad Request".

api_message

The message field from the JSON error body, if present.

SEE ALSO

Net::Async::Zitadel, Net::Async::Zitadel::OIDC, Net::Async::Zitadel::Management

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-net-async-zitadel/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

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