# error -- deliver error message

## Synopsis

• Usage:
error s
• Inputs:
• s, , a string or a sequence of things that can be converted to strings
• Consequences:
• an error message is displayed

## Description

error s causes an error message s to be displayed.

The error message s (which should be a string or a sequence of things that can be converted to strings and concatenated) is printed. Execution of the code is interrupted, and control is returned to top level. Here is an explicit example showing how this command is used:

exampleCode = p -> (
if not isPrime p
then error "expected a prime integer";
if p == 2
then error "expected an odd prime";
lift((p+1)/2, ZZ)
);

Eventually we will have a means of ensuring that the line number printed out with the error message will have more significance, but currently it is the location in the code of the error expression itself.

If the error message begins with a hyphen, then the word "error" will not be inserted into the error message.

## For the programmer

The object error is .