Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public interface CMConstants {
// status code 200 - Error substrings - check it contains.
String ERROR_UNKNOWN = "Unknown error";
String ERROR_NO_ACCOUNT = "No account found";
String ERROR_NO_USER = "No or incorrect User node found";
String ERROR_INSUFICIENT_BALANCE = "Insufficient balance";
String ERROR_UNROUTABLE_MESSAGE = "Message is unroutable";
String ERROR_INVALID_PRODUCT_TOKEN = "Invalid product token";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private void doHttpPost(final String urlString, final String requestString) {

if (line.contains(CMConstants.ERROR_UNKNOWN)) {
throw new UnknownErrorException();
} else if (line.contains(CMConstants.ERROR_NO_ACCOUNT)) {
} else if (line.contains(CMConstants.ERROR_NO_ACCOUNT) || line.contains(CMConstants.ERROR_NO_USER)) {
throw new NoAccountFoundForProductTokenException();
} else if (line.contains(CMConstants.ERROR_INSUFICIENT_BALANCE)) {
throw new InsufficientBalanceException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void testAsPartOfARoute() {

// Body
final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateUnicodeMessage(), validNumber, null);
assertThrows(CMResponseException.class,
assertThrows(NoAccountFoundForProductTokenException.class,
() -> cmProxy.send(smsMessage));
}

Expand Down