@@ -50,11 +50,13 @@ internal open class UserManager(
50
50
Logging .log(LogLevel .DEBUG , " setAlias(label: $label , id: $id )" )
51
51
52
52
if (label.isEmpty()) {
53
- throw Exception (" Cannot add empty alias" )
53
+ Logging .log(LogLevel .ERROR , " Cannot add empty alias" )
54
+ return
54
55
}
55
56
56
57
if (label == IdentityConstants .ONESIGNAL_ID ) {
57
- throw Exception (" Cannot add '${IdentityConstants .ONESIGNAL_ID } ' alias" )
58
+ Logging .log(LogLevel .ERROR , " Cannot add '${IdentityConstants .ONESIGNAL_ID } ' alias" )
59
+ return
58
60
}
59
61
60
62
_identityModel [label] = id
@@ -65,11 +67,13 @@ internal open class UserManager(
65
67
66
68
aliases.forEach {
67
69
if (it.key.isEmpty()) {
68
- throw Exception (" Cannot add empty alias" )
70
+ Logging .log(LogLevel .ERROR , " Cannot add empty alias" )
71
+ return
69
72
}
70
73
71
74
if (it.key == IdentityConstants .ONESIGNAL_ID ) {
72
- throw Exception (" Cannot add '${IdentityConstants .ONESIGNAL_ID } ' alias" )
75
+ Logging .log(LogLevel .ERROR , " Cannot add '${IdentityConstants .ONESIGNAL_ID } ' alias" )
76
+ return
73
77
}
74
78
}
75
79
@@ -82,11 +86,13 @@ internal open class UserManager(
82
86
Logging .log(LogLevel .DEBUG , " removeAlias(label: $label )" )
83
87
84
88
if (label.isEmpty()) {
85
- throw Exception (" Cannot remove empty alias" )
89
+ Logging .log(LogLevel .ERROR , " Cannot remove empty alias" )
90
+ return
86
91
}
87
92
88
93
if (label == IdentityConstants .ONESIGNAL_ID ) {
89
- throw Exception (" Cannot remove '${IdentityConstants .ONESIGNAL_ID } ' alias" )
94
+ Logging .log(LogLevel .ERROR , " Cannot remove '${IdentityConstants .ONESIGNAL_ID } ' alias" )
95
+ return
90
96
}
91
97
92
98
_identityModel .remove(label)
@@ -97,11 +103,13 @@ internal open class UserManager(
97
103
98
104
labels.forEach {
99
105
if (it.isEmpty()) {
100
- throw Exception (" Cannot remove empty alias" )
106
+ Logging .log(LogLevel .ERROR , " Cannot remove empty alias" )
107
+ return
101
108
}
102
109
103
110
if (it == IdentityConstants .ONESIGNAL_ID ) {
104
- throw Exception (" Cannot remove '${IdentityConstants .ONESIGNAL_ID } ' alias" )
111
+ Logging .log(LogLevel .ERROR , " Cannot remove '${IdentityConstants .ONESIGNAL_ID } ' alias" )
112
+ return
105
113
}
106
114
}
107
115
0 commit comments