Skip to content

Commit 1dac0ba

Browse files
committed
Fixed #22: ApiKey can't be changed after the client has been initialized.
@ejsmith Can you please review this change... I wasn't able to reproduce the issue with autostart but I believe this commit and my previous commit will resolve this issue.
1 parent 1b599d8 commit 1dac0ba

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Source/Shared/ExceptionlessClient.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ public bool UpdateUserEmailAndDescription(string referenceId, string email, stri
6363
return false;
6464
}
6565

66+
if (!Configuration.IsValid) {
67+
_log.Value.FormattedInfo(typeof(ExceptionlessClient), "Configuration is invalid: {0}. The event will not be updated with the user email and description.", String.Join(", ", Configuration.Validate().Messages));
68+
return false;
69+
}
70+
6671
if (!Configuration.IsLocked) {
6772
Configuration.LockConfig();
6873
if (!Configuration.IsValid) {
@@ -92,6 +97,11 @@ public Task ProcessQueueAsync() {
9297
return Threading.Tasks.TaskExtensions.FromResult(0);
9398
}
9499

100+
if (!Configuration.IsValid) {
101+
_log.Value.FormattedInfo(typeof(ExceptionlessClient), "Configuration is invalid: {0}. The queue will not be processed.", String.Join(", ", Configuration.Validate().Messages));
102+
return Threading.Tasks.TaskExtensions.FromResult(0);
103+
}
104+
95105
if (!Configuration.IsLocked) {
96106
Configuration.LockConfig();
97107
if (!Configuration.IsValid) {
@@ -123,7 +133,12 @@ public void SubmitEvent(Event ev, ContextData pluginContextData = null) {
123133
throw new ArgumentNullException("ev");
124134

125135
if (!Configuration.Enabled) {
126-
_log.Value.Info(typeof(ExceptionlessClient), "Configuration is disabled. The error will not be submitted.");
136+
_log.Value.Info(typeof(ExceptionlessClient), "Configuration is disabled. The event will not be submitted.");
137+
return;
138+
}
139+
140+
if (!Configuration.IsValid) {
141+
_log.Value.FormattedInfo(typeof(ExceptionlessClient), "Configuration is invalid: {0}. The event will not be submitted.", String.Join(", ", Configuration.Validate().Messages));
127142
return;
128143
}
129144

0 commit comments

Comments
 (0)