You can produce your own string to describe an error message with the throw or error or ERROR command.
With the following program:
| f(x):={ if (type(x)!=DOM\_INT) throw("Not an integer"); else return x; } | 
input:
| f(12) | 
| 
 | 
since 12 is an integer.
| f(1.2) | 
will signal an error
| 
 | 
since 1.2 in not an integer.