NAME

WebService::OPNsense::Exception - Structured exception class for OPNsense API errors

VERSION

version 0.002

SYNOPSIS

use WebService::OPNsense::Exception;

WebService::OPNsense::Exception->throw(
    message     => 'Not Found',
    http_status => 404,
    response    => $res,
);

DESCRIPTION

Exception class used by WebService::OPNsense to report API errors. Stringifies to the error message via use overload '""'.

When the environment variable CARP_DATUM is set, this class extends Carp::Datum to enable structured exception handling and additional context in stack traces.

ATTRIBUTES

message (required)

Human-readable error description.

http_status

HTTP status code, if applicable.

response

Original WebService::Client::Response object.

METHODS

throw

WebService::OPNsense::Exception->throw(%attrs);

Constructs and throws a new exception.

SEE ALSO

WebService::OPNsense

AUTHOR

Dean Hamstead <dean@fragfest.com.au>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Dean Hamstead.

This is free software, licensed under:

The MIT (X11) License