home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / dev / e / amiga_e / src / tools / exceptions / exceptions.e next >
Encoding:
Text File  |  1992-09-02  |  625 b   |  26 lines

  1. -> general exception catcher for test purposes
  2.  
  3. OPT MODULE
  4.  
  5. EXPORT PROC report_exception()
  6.   DEF e[5]:ARRAY
  7.   IF exception
  8.     WriteF('Program terminated by exception: ')
  9.     IF exception<10000
  10.       WriteF('\d\n',exception)
  11.     ELSE
  12.       SELECT exception
  13.         CASE "MEM";  WriteF('no memory\n')
  14.         CASE "OPEN"; WriteF('could not open file \s\n',IF exceptioninfo THEN exceptioninfo ELSE '')
  15.         CASE "^C";   WriteF('***BREAK\n')
  16.         -> and others...
  17.         DEFAULT
  18.           e[4]:=0
  19.           ^e:=exception
  20.           WHILE e[]=0 DO e++
  21.           WriteF('"\s"\n',e)
  22.       ENDSELECT
  23.     ENDIF
  24.   ENDIF
  25. ENDPROC
  26.