- m.setContactName(number, name);
- } catch (InvalidNumberException e) {
- System.out.println("Invalid contact number: " + e.getMessage());
+ var expiration = ns.getInt("expiration");
+ if (expiration != null) {
+ m.setExpirationTimer(recipient, expiration);
+ }
+
+ var name = ns.getString("name");
+ if (name != null) {
+ m.setContactName(recipient, name);
+ }
+ } catch (IOException e) {
+ throw new IOErrorException("Update contact error: " + e.getMessage(), e);
+ } catch (NotMasterDeviceException e) {
+ throw new UserErrorException("This command doesn't work on linked devices.");