throw

final_realms_fluffos_v1/lib/doc/driver/efuns/system/throw · 712 B

From the archive final_realms_fluffos_v1.zip

Download the archive   « Back to the archive contents

.\"forces an error to occur in an object.

.DT
throw
Discworld driver help
throw

Name
.SI 5
throw() - forces an error to occur in an object.

.EI
Synopsis
.SI 5
void throw(mixed);

.EI
Description
.SP 5 5
The throw() efun may be used to force an error to occur in an object.  When
used in conjunction, throw() and catch() allow the programmer to choose what
error message is displayed when a runtime error occurs.  When throw() is used,
it should be used in conjunction with the catch(3) efun.  Here is a typical
usage:

   string err;
   int rc;

   err = catch(rc = ob->move(dest));
   if (err) {
        throw("move.c: ob->move(dest): " + err + "\n");
        return;
   }

.EP
See also
.SI 5
catch(3).

.EI

Site Stats

Snippets: 1791
Codebases: 571