- Perl 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| dist | ||
| lib | ||
| LICENSE | ||
| Makefile.PL | ||
| README.md | ||
NAME
ErrData - Standard error code, message and context sub-object
VERSION
version 1.1
SYNOPSIS
$obj = ErrData->new;
# Set the directory pathname
$obj->set_error_cd_msg_ctx( 2, 'Failed connect', 'fetch_sub_data' );
# Retrieve the data after the fact
($code,$msg,$ctx) = $obj->get_error_cd_msg_ctx;
DESCRIPTION
ErrData is a module to provide a standardised object access to a tuple of error data.
It is designed to be used as a perl parent class as part of
some larger object. The expected usage is to call the
reset_error_cd_msg_ctx method on entry to a major entry
method and the to have the set_error_cd_msg_ctx method being
called as the return argument at completion or early termination.
METHODS
-
set_error_cd_msg_ctx
# basic use $obj->set_error_cd_msg_ctx( 2, 'Failed connect', 'fetch_sub_data' ); # typical use in a parent-using object return $self->set_error_cd_msg_ctx( 2, 'Failed connect', 'fetch_sub_data' ) if ! $self->_internal_method($args);Takes three arguments
- error_code - numeric
- error_message - string - explaining the problem
- error_context - string - where the error occurred
Returns either the
error_codemember, or an array of all three items. -
get_error_cd_msg_ctx
Returns either the
error_codemember, or an array of all three items. -
reset_error_cd_msg_ctx
Clears the three member attributes
-
error_code
Get or set the
error_codeattribute. -
error_message
Get or set the
error_messageattribute. -
error_context
Get or set the
error_contextattribute.
COMPATIBILITY
ErrDatarequiresClass::Accessorize.
AUTHOR
Bernard Quatermass toolsmith@quatermass.co.uk
COPYRIGHT AND LICENSE
This software is copyright (c) 2020 by Bernard Quatermass.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.