diff options
author | Raul Santos <raulsntos@gmail.com> | 2022-08-24 13:54:47 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2022-08-26 16:56:00 +0200 |
commit | 79f9f59a87c10bd85c7a31f4b5017bce5bfbbeb1 (patch) | |
tree | 26b47308d7f5752abae3dcefe2b3f7fa56721a65 /modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils | |
parent | 9876382df8c0fcb7880ca20b053d1f2b2a358785 (diff) |
Fix various C# exceptions
- Replace `IndexOutOfRangeException` with `ArgumentOutOfRangeException`
- Replace `Exception` with a more specific exception
- Add the parameter name to argument exception
- Update documentation for methods that throw exceptions
- Use `StringBuilder` to build exception messages
- Ensure exception messages end with a period
Diffstat (limited to 'modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils')
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs index d84a63c83c..a285d5fa97 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs @@ -21,14 +21,14 @@ namespace GodotTools.IdeMessaging.Utils public void OnCompleted(Action continuation) { if (this.continuation != null) - throw new InvalidOperationException("This awaiter has already been listened"); + throw new InvalidOperationException("This awaiter already has a continuation."); this.continuation = continuation; } public void SetResult(T result) { if (IsCompleted) - throw new InvalidOperationException("This awaiter is already completed"); + throw new InvalidOperationException("This awaiter is already completed."); IsCompleted = true; this.result = result; @@ -39,7 +39,7 @@ namespace GodotTools.IdeMessaging.Utils public void SetException(Exception exception) { if (IsCompleted) - throw new InvalidOperationException("This awaiter is already completed"); + throw new InvalidOperationException("This awaiter is already completed."); IsCompleted = true; this.exception = exception; |