ARSperl Manual - Error Hash Structure

## Error Hash (%ars_errhash) Structure

This hash contains any error, warning or informational messages that are returned from the C API or Perl API. It is reset whenever you call an ARSperl function. Therefor, you should examine it after calling an ARSperl function and before calling another ARSperl function.

      "numItems"    => integer,
      "messageType" => reference to an array of integers,
      "messageNum"  => reference to an array of integers,
      "messageText" => reference to an array of strings

Example:

There are two ways of accessing this information:

This will format the information for you.

    	print "$ars_errstr\n";

This is the equivalent behind the scenes code.

        my(%mTypes) = ( 0 => "OK", 1 => "WARNING", 2 => "ERROR", 3 => "FATAL",
                        4 => "INTERNAL ERROR",
                       -1 => "TRACEBACK");

        for($i = 0; $i < $ARS::ars_errhash{numItems}; $i++) {
            printf("[%s] %s (ARERR \#%d)\n",
                   $mTypes{@{$ARS::ars_errhash{messageType}}[$i]},
                   @{$ARS::ars_errhash{messageText}}[$i],
                   @{$ARS::ars_errhash{messageNum}}[$i]);
        }

Table of Contents