swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax   Related Concepts  
built-in catch name  

#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 ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.