- if (usernames.size() > 1) {
- System.err.println("Multiple users found, you need to specify a username (phone number) with -u");
- return 1;
+ if (usernames.size() == 0) {
+ throw new UserErrorException("No local users found, you first need to register or link an account");
+ } else if (usernames.size() > 1) {
+ throw new UserErrorException(
+ "Multiple users found, you need to specify a username (phone number) with -u");