Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors


Manual Reference Pages  - error_now (5)

NAME

error/now - Generate a new error condition

CONTENTS

Synopsis
Description
Error Handling
Examples
See Also
Author

SYNOPSIS

error/now ![objectref]
error/now ![objectref], [desc]
error/now

DESCRIPTION

Generates a new error condition using the error type object identified by the objectref argument, and with an optional custom description provided by the desc text argument.

If no arguments are provided, then a new error condition is created using the details of the last error to have occurred. This is generally used in error handlers to pass on an error that it is actually unable to handle.

If the desc argument is a register containing the type PSUNIT_TYPE STRING and the instruction does not generate an error, then the register will be cleared as the data is now referenced elsewhere. The memory taken by the byte string will be released when the error state is cleared by error/clr or, if the error is not trapped, when the thread exits.

ERROR HANDLING

A runtime error occurs if the arguments are the wrong type, or if the object pointed to by the first argument does not exist.

EXAMPLES

error/now ![.prose.error.sys.OutOfMemory], [Can’t read data]
  Generates a new out of memory error condition, with an additional message that says "Can’t read data".

SEE ALSO

pal_commands(5), pal_registers(5), pal_indices(5), ps_errortypes(5), error_def(5), error_clr(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

Copyright (c) 2002-2013 Mark R. Bannister <cambridge@users.sourceforge.net>.

This is free software and can be downloaded from prose.sourceforge.net; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


PAL 1.0 error_now (5) 8 February 2013
Generated by manServer 1.07 from man5/error_now.5 using man macros.