Dave,

Simply use the ERROR command and list your error number as user error via AddUserError.