Without any arguments, return the last error message. With one argument, set the last error message to msg. With two arguments, also set the last message identifier.