mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Improve error message when an account is already in use
This commit is contained in:
parent
c8b9ab1911
commit
6c1013b024
2 changed files with 9 additions and 0 deletions
|
@ -27,6 +27,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.OverlappingFileLockException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
@ -182,6 +183,9 @@ public class SignalJsonRpcDispatcherHandler {
|
|||
final var registrationManager = c.getNewRegistrationManager(params.get("account").asText());
|
||||
((ObjectNode) params).remove("account");
|
||||
return registrationManager;
|
||||
} catch (OverlappingFileLockException e) {
|
||||
logger.warn("Account is already in use");
|
||||
return null;
|
||||
} catch (IOException | IllegalStateException e) {
|
||||
logger.warn("Failed to load registration manager", e);
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue