@@ -122,7 +122,8 @@ internal open class UserManager(
122
122
Logging .log(LogLevel .DEBUG , " addEmail(email: $email )" )
123
123
124
124
if (! OneSignalUtils .isValidEmail(email)) {
125
- throw Exception (" Cannot add invalid email address as subscription: $email " )
125
+ Logging .log(LogLevel .ERROR , " Cannot add invalid email address as subscription: $email " )
126
+ return
126
127
}
127
128
128
129
_subscriptionManager .addEmailSubscription(email)
@@ -132,7 +133,8 @@ internal open class UserManager(
132
133
Logging .log(LogLevel .DEBUG , " removeEmail(email: $email )" )
133
134
134
135
if (! OneSignalUtils .isValidEmail(email)) {
135
- throw Exception (" Cannot remove invalid email address as subscription: $email " )
136
+ Logging .log(LogLevel .ERROR , " Cannot remove invalid email address as subscription: $email " )
137
+ return
136
138
}
137
139
138
140
_subscriptionManager .removeEmailSubscription(email)
@@ -142,7 +144,8 @@ internal open class UserManager(
142
144
Logging .log(LogLevel .DEBUG , " addSms(sms: $sms )" )
143
145
144
146
if (! OneSignalUtils .isValidPhoneNumber(sms)) {
145
- throw Exception (" Cannot add invalid sms number as subscription: $sms " )
147
+ Logging .log(LogLevel .ERROR , " Cannot add invalid sms number as subscription: $sms " )
148
+ return
146
149
}
147
150
148
151
_subscriptionManager .addSmsSubscription(sms)
@@ -152,7 +155,8 @@ internal open class UserManager(
152
155
Logging .log(LogLevel .DEBUG , " removeSms(sms: $sms )" )
153
156
154
157
if (! OneSignalUtils .isValidPhoneNumber(sms)) {
155
- throw Exception (" Cannot remove invalid sms number as subscription: $sms " )
158
+ Logging .log(LogLevel .ERROR , " Cannot remove invalid sms number as subscription: $sms " )
159
+ return
156
160
}
157
161
158
162
_subscriptionManager .removeSmsSubscription(sms)
0 commit comments