swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax   Related Concepts  
constant   #external-exception    

Purpose

#external-exception is a built-in catch name that you can use to catch errors generated by OmniMark's interaction with the outside world. OmniMark will generate a throw to #external-exception when it encounters a problem dealing with the file system, for instance. Many OmniMark external function libraries will also throw to #external-exception when they encounter an error.

If a throw to #external-exception is not caught, OmniMark will generate a throw to #program-error.

#external-exception has three parameters:

When you create a catch for #external-exception, it is only necessary to specify the parameters you will be using in the catch block.

  process
  	local stream my-stream  do
  	open my-stream as file "/just/not/there"
  	catch #external-exception
  		output "Something went wrong. Don't know what it was.%n"
  	done

The following code uses all the parameters of #external-exception.

  process
     local stream my-stream
     open my-stream as file "/just/not/there"
     catch #external-exception
        identity error-code
        message error-message
        location error-location
        output "I know what went wrong:%n"
            || "The error code is: " || error-code || "%n"
            || "The error message is: " || error-message || "%n"
            || "The error location is: " || error-location || "%n"

  Related Syntax
   #program-error
   always
   throw
   rethrow
   catch
 
Related Concepts
   Catch and throw
 
----  

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:06:50 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.