swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  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 ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:44:52 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.