mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Handle rate limit exception correctly when querying usernames
Fixes #1797
This commit is contained in:
parent
a96626c468
commit
ca33249170
5 changed files with 34 additions and 14 deletions
|
@ -64,9 +64,16 @@ public class GetUserStatusCommand implements JsonRpcLocalCommand {
|
|||
}
|
||||
|
||||
final var usernames = ns.<String>getList("username");
|
||||
final var registeredUsernames = usernames == null
|
||||
? Map.<String, UsernameStatus>of()
|
||||
: m.getUsernameStatus(new HashSet<>(usernames));
|
||||
final Map<String, UsernameStatus> registeredUsernames;
|
||||
try {
|
||||
registeredUsernames = usernames == null ? Map.of() : m.getUsernameStatus(new HashSet<>(usernames));
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Unable to check if users are registered: "
|
||||
+ e.getMessage()
|
||||
+ " ("
|
||||
+ e.getClass().getSimpleName()
|
||||
+ ")", e);
|
||||
}
|
||||
|
||||
// Output
|
||||
switch (outputWriter) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue