Prevent exceptions from escaping FileSystemWatcher events#4535
Merged
sharwell merged 1 commit intodotnet:masterfrom Dec 8, 2019
Merged
Prevent exceptions from escaping FileSystemWatcher events#4535sharwell merged 1 commit intodotnet:masterfrom
sharwell merged 1 commit intodotnet:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4535 +/- ##
==========================================
- Coverage 75.1% 75.1% -0.01%
==========================================
Files 908 908
Lines 160260 160260
Branches 17259 17259
==========================================
- Hits 120369 120361 -8
- Misses 35070 35083 +13
+ Partials 4821 4816 -5
|
sharwell
commented
Dec 7, 2019
| public static readonly EventId FileReloadBegin = new EventId(100, "FileReloadBegin"); | ||
| public static readonly EventId FileReloadEnd = new EventId(101, "FileReloadEnd"); | ||
| public static readonly EventId FileReload = new EventId(102, "FileReload"); | ||
| public static readonly EventId FileReloadError = new EventId(103, nameof(FileReloadError)); |
Contributor
Author
There was a problem hiding this comment.
📝 I wanted to make this have the same order as UriModelLoader, but I was not sure if these event IDs need to be stable over time. Since I wasn't sure, I opted for keeping the current IDs unchanged and just added the new one.
7febe71 to
b220486
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exceptions in the handler of FileSystemWatcher events will terminate the process. This pull request updates the event handler to use a try/catch block that logs the error instead of crashing the process.
This fixes one known cause of test process failures.