@Override
public int handleCommand(final Namespace ns, final Manager m) {
- if (!m.isRegistered()) {
- System.err.println("User is not registered.");
- return 1;
- }
try {
m.sendContacts();
return 0;
- } catch (IOException | UntrustedIdentityException e) {
+ } catch (UntrustedIdentityException e) {
+ System.err.println("SendContacts error: " + e.getMessage());
+ return 2;
+ } catch (IOException e) {
System.err.println("SendContacts error: " + e.getMessage());
return 3;
}