Node: Errors, Next: , Previous: File System Interface, Up: Top



Errors

error string args Function

error takes a string argument string and 0 or more optional arguments args and reports an Lpp error message using string and enters an error handler. The string argument can be either an Lpp String or a char* string and it may contain printf style substitution specifiers that correspond to the optional args just as in printf. For example:

     if (typeOf(object) != type(MyType)) {
       char* objectID = sL(prin1ToString(object));
       char* expectType = typeName(type(MyTupe));
       error("Object %s is not of type: %s", objectID, expectType);}