REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 13-Feb-2009 Edit History  

REBOL 3 Usage: Errors

Error Messages

There are several types of errors within REBOL. When an error occurs a message is displayed that tells you what the error was and approximately where it occurred. For instance if you type:

** Script Error: abc has no value.
** Where: abc

The type of error is indicated by the first few words of the message. In the above example, the error is a Script Error. Script errors are the most common and occur when you use a function of the language in the wrong way or with improper arguments. Other types of errors are described in [bad-link:concepts/error.txt] Types.

Error Type Description
Syntax errors Occur when the script contains an invalid value or a missing header, quote, bracket, or parenthesis.
Math errors Occur when dividing a number by zero or there was a math overflow or underflow.
Access errors Occur when a file, directory, or network operation cannot be accessed or access permissions are restricted.
Throw errors Occur when a break, exit, or throw is used in an improper manner.
User errors Defined by the user's script.
Internal errors Returned when a problem occurs within the REBOL system. If you encounter one of these types of errors, please report it to [bad-link:concepts/feedback.txt].

Most types of errors can be trapped and processed by your script. See [bad-link:concepts/trying.txt] Blocks for a description of the try function.

Redirecting Errors

When errors are encountered in non-interactive sessions, such as when running in CGI mode (-c or --cgi ) or in no window mode (-w or --nowindow ), the session is automatically terminated.

If a script terminates while running in non-interactive mode, you can use shell redirection to output the error to a file:

REBOL -cs my_script.r >> my_script.log

This appends the output to the file in most operating systems.

  TOC < Back Next > - WIP Wiki Feedback Admin