- throw new IOErrorException("Failed to send message: " + e.getMessage());
- } catch (AssertionError e) {
- handleAssertionError(e);
- throw e;
- } catch (GroupNotFoundException e) {
- throw new UserErrorException("Failed to send to group: " + e.getMessage());
- } catch (NotAGroupMemberException e) {
- throw new UserErrorException("Failed to send to group: " + e.getMessage());
- } catch (InvalidNumberException e) {
- throw new UserErrorException("Invalid number: " + e.getMessage());
+ throw new UnexpectedErrorException("Failed to send message: " + e.getMessage() + " (" + e.getClass()
+ .getSimpleName() + ")", e);
+ } catch (UnregisteredRecipientException e) {
+ throw new UserErrorException("The user " + e.getSender().getIdentifier() + " is not registered.");