[REBOL] Trapping an error
From: Steven:White:ci:bloomington:mn:us at: 7-Nov-2003 9:05
I am wondering if someone can tell me how to trap a particular error.
Yes, I have read the GDM, on "try" and "attempt," but they don't seem to
be the correct answer. (It is quite possible I don't fully understand
the documentation.)
Here is the situation:
I have a "configuration file" for a script. The configuration file is
itself a little REBOL script that just sets the values of some words,
for example
REBOL [
File: %config.r
]
HELP-FILENAME: %XXXXXX
In the main script, I set default values for those things in the
configuration file, and then "do" the configuration file to over-ride
the default values. For example
REBOL [
File: %main.r
]
HELP-FILENAME: %YYYYY ;;; set default value
do %config.r ;;; override default value
This works just fine EXCEPT if I put an incorrectly-formatted file name
in the configuration file. If the file name in the configuration file
is bad, then when I "do" that file the script crashes.
Is there a way to trap that error before the REBOL interpreter does, so
that I can handle the error in my own way?
Thank you.
Steven White
City of Bloomington
1800 W Old Shakopee Rd
Bloomington MN 55431-3096
USA
952-563-4882 (voice)
952-563-4672 (fax)
[steven--white--ci--bloomington--mn--us]