Print user number in UserAlreadyExistsException DBus error

Currently, the error looks like "UserAlreadyExistsException null", which does not give enough information to handle this situation in the multi-account daemon mode.

This change adds a phone number to the error message resolving my issue and achieving functional parity with CLI interface.
This commit is contained in:
Artemii Bigdan 2025-12-03 12:55:42 +01:00 committed by Sebastian Scheibner
parent 8dcc16d640
commit 11d96c894d

View File

@ -145,7 +145,9 @@ public class DbusSignalControlImpl implements org.asamk.SignalControl {
try { try {
final var provisioningManager = c.getProvisioningManagerFor(new URI(deviceLinkUri)); final var provisioningManager = c.getProvisioningManagerFor(new URI(deviceLinkUri));
return provisioningManager.finishDeviceLink(newDeviceName); return provisioningManager.finishDeviceLink(newDeviceName);
} catch (TimeoutException | IOException | UserAlreadyExistsException | URISyntaxException e) { } catch (UserAlreadyExistsException e) {
throw new SignalControl.Error.Failure(e.getClass().getSimpleName() + " " + e.getNumber());
} catch (TimeoutException | IOException | URISyntaxException e) {
throw new SignalControl.Error.Failure(e.getClass().getSimpleName() + " " + e.getMessage()); throw new SignalControl.Error.Failure(e.getClass().getSimpleName() + " " + e.getMessage());
} }
} }