Exception
NAME
X::OpenMPT::Bindings - Exception class for libopenmpt errors
DESCRIPTION
Thrown when a libopenmpt C API function returns an error. Captures the
$function name, numeric error $code, and human-readable $message.
ATTRIBUTES
function
method function(--> Str)
The name of the C API function that failed (e.g. openmpt_module_create_from_memory2).
code
method code(--> Int)
The libopenmpt error code (one of the OpenMPTError enum values).
message
method message(--> Str)
Human-readable error description returned by libopenmpt. Note: message
is declared as $!message is built ā the constructor accepts
:message(...) as a named argument, and the message() method returns
the formatted string (not the raw argument).
USAGE
try {
OpenMPT::Bindings::Module.from-blob($bad-data);
CATCH {
when X::OpenMPT::Bindings {
say .function;
say .code;
say .message;
}
}
}