ES2 MUD LIB :: 東方故事二(ES2) 天朝帝國 mudlib 瀏覽展示

/doc/efuns/throw

HOME :: doc :: efuns :: throw

     tttthhhhrrrroooowwww((((3333))))               MMMMuuuuddddOOOOSSSS ((((5555 SSSSeeeepppp 1111999999994444))))                tttthhhhrrrroooowwww((((3333))))

     NNNNAAAAMMMMEEEE
          throw() - forces an error to occur in an object.

     SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
          void throw(mixed);

     DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
          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;
             }

     SSSSEEEEEEEE AAAALLLLSSSSOOOO
          catch(3), error(3), error_handler(4)

     Page 1                                          (printed 3/16/95)

HOME :: doc :: efuns :: throw