No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-11-17 16:51:54 +00:00
dist Add explicit Provides to spec 2022-11-17 16:51:54 +00:00
lib merge tweaks 2021-02-17 05:42:19 +00:00
LICENSE Initial Commit 2020-01-27 17:11:40 +00:00
Makefile.PL Correct URLs in Makefile.PL 2021-02-18 16:50:34 +00:00
README.md merge tweaks 2021-02-17 05:42:19 +00:00

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_code member, or an array of all three items.

  • get_error_cd_msg_ctx

    Returns either the error_code member, or an array of all three items.

  • reset_error_cd_msg_ctx

    Clears the three member attributes

  • error_code

    Get or set the error_code attribute.

  • error_message

    Get or set the error_message attribute.

  • error_context

    Get or set the error_context attribute.

COMPATIBILITY

  • ErrData requires Class::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.