Improve error message when an account is already in use

This commit is contained in:
AsamK 2021-12-05 12:00:49 +01:00
parent c8b9ab1911
commit 6c1013b024
2 changed files with 9 additions and 0 deletions

View file

@ -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;