NAME

Net::FreeIPA::Error is an error class for Net::FreeIPA.

Boolean logic and (non)-equal operator are overloaded using is_error method. (Use == and != also for name/message, not eq / ne operators).

Public methods

mkerror

A Net::FreeIPA::Error factory

new

Create new error instance from options, e.g. from a (decoded dereferenced) JSON response.

Arguments are handled by set_error.

set_error

Process arguments to error

no args/undef: reset the error attribute
single argument string: convert to an Error instance with message
single argument hasref/Error instance: make a copy
single argument/other: set Error message and save original in _orig attribute
options (more than one arg): set the options
is_error

Test if this is an error or not.

If an optiona l type argument is passed, test if error name or code is equal to type.

A numerical type is compare to the code, a string is compare to the name or message

For a set of known errorcodes, a automatic reverse lookup is performed. When e.g. only the error name attribute is set, one can test using a known errorcode.

is_duplicate

Test if this is a DuplicateEntry error

is_not_found

Test if this is a NotFound error