updating oE crash

Errors and Warnings



include error.e 
namespace error 
public procedure crash(sequence fmt, object data = {}) 

crashes the running program and displays a formatted error message.

  1. fmt : a sequence representing the message text. It may have format specifiers in it
  2. data : an object, defaulted to {}.

Formatting is the same as with printf.

The actual message being shown, both on standard error and in ex.err (or whatever file last passed to crash_file), is sprintf(fmt, data). The program terminates as for any runtime error.

Example 1:
if PI = 3 then 
    crash("The structure of universe just changed -- reload solar_system.ex") 
end if 
Example 2:
if token = end_of_file then 
    crash("Test file #%d is bad, text read so far is %s\n",  
                                                  {file_number, read_so_far}) 
end if 
See Also:

crash_file, crash_message, printf

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu