Skip to content

Commit

Permalink
Show better error message when using addDevice on a linked device
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed Aug 21, 2023
1 parent 6d23eb3 commit a9f1944
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ public void addDevice(String uri) {
m.addDeviceLink(deviceLinkUrl);
} catch (IOException | InvalidDeviceLinkException e) {
throw new Error.Failure(e.getClass().getSimpleName() + " Add device link failed. " + e.getMessage());
} catch (NotPrimaryDeviceException e) {
throw new Error.Failure("This command doesn't work on linked devices.");
} catch (URISyntaxException e) {
throw new Error.InvalidUri(e.getClass().getSimpleName()
+ " Device link uri has invalid format: "
Expand Down

0 comments on commit a9f1944

Please sign in to comment.