Raise better error message when username or token is empty.