mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Improve stderr output
This commit is contained in:
parent
2c3d222e84
commit
2c5a70cc47
6 changed files with 9 additions and 10 deletions
|
@ -43,7 +43,7 @@ public class ListIdentitiesCommand implements LocalCommand {
|
||||||
printIdentityFingerprint(m, id);
|
printIdentityFingerprint(m, id);
|
||||||
}
|
}
|
||||||
} catch (InvalidNumberException e) {
|
} catch (InvalidNumberException e) {
|
||||||
System.out.println("Invalid number: " + e.getMessage());
|
System.err.println("Invalid number: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -3,11 +3,11 @@ package org.asamk.signal.commands;
|
||||||
import net.sourceforge.argparse4j.inf.Namespace;
|
import net.sourceforge.argparse4j.inf.Namespace;
|
||||||
import net.sourceforge.argparse4j.inf.Subparser;
|
import net.sourceforge.argparse4j.inf.Subparser;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import org.asamk.signal.manager.Manager;
|
import org.asamk.signal.manager.Manager;
|
||||||
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class UpdateContactCommand implements LocalCommand {
|
public class UpdateContactCommand implements LocalCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -42,7 +42,8 @@ public class UpdateContactCommand implements LocalCommand {
|
||||||
m.setExpirationTimer(number, expiration);
|
m.setExpirationTimer(number, expiration);
|
||||||
}
|
}
|
||||||
} catch (InvalidNumberException e) {
|
} catch (InvalidNumberException e) {
|
||||||
System.out.println("Invalid contact number: " + e.getMessage());
|
System.err.println("Invalid contact number: " + e.getMessage());
|
||||||
|
return 1;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.println("Update contact error: " + e.getMessage());
|
System.err.println("Update contact error: " + e.getMessage());
|
||||||
return 3;
|
return 3;
|
||||||
|
|
|
@ -556,9 +556,7 @@ public class Manager implements Closeable {
|
||||||
for (ContactTokenDetails contact : contacts) {
|
for (ContactTokenDetails contact : contacts) {
|
||||||
newE164Members.remove(contact.getNumber());
|
newE164Members.remove(contact.getNumber());
|
||||||
}
|
}
|
||||||
System.err.println("Failed to add members " + Util.join(", ", newE164Members) + " to group: Not registered on Signal");
|
throw new IOException("Failed to add members " + Util.join(", ", newE164Members) + " to group: Not registered on Signal");
|
||||||
System.err.println("Aborting…");
|
|
||||||
System.exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g.addMembers(members);
|
g.addMembers(members);
|
||||||
|
|
|
@ -70,7 +70,7 @@ class JsonPreKeyStore implements PreKeyStore {
|
||||||
try {
|
try {
|
||||||
preKeyMap.put(preKeyId, Base64.decode(preKey.get("record").asText()));
|
preKeyMap.put(preKeyId, Base64.decode(preKey.get("record").asText()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println(String.format("Error while decoding prekey for: %s", preKeyId));
|
System.err.println(String.format("Error while decoding prekey for: %s", preKeyId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ class JsonSessionStore implements SessionStore {
|
||||||
SessionInfo sessionInfo = new SessionInfo(serviceAddress, deviceId, Base64.decode(record));
|
SessionInfo sessionInfo = new SessionInfo(serviceAddress, deviceId, Base64.decode(record));
|
||||||
sessionStore.sessions.add(sessionInfo);
|
sessionStore.sessions.add(sessionInfo);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println(String.format("Error while decoding session for: %s", sessionName));
|
System.err.println(String.format("Error while decoding session for: %s", sessionName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ class JsonSignedPreKeyStore implements SignedPreKeyStore {
|
||||||
try {
|
try {
|
||||||
preKeyMap.put(preKeyId, Base64.decode(preKey.get("record").asText()));
|
preKeyMap.put(preKeyId, Base64.decode(preKey.get("record").asText()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println(String.format("Error while decoding prekey for: %s", preKeyId));
|
System.err.println(String.format("Error while decoding prekey for: %s", preKeyId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue