Register error message text. Returns an error number which should be used when the exception handler is invoked.