Repository navigation
Improve failure reporting when platform tools fail to start - #690
Merged
soujay merged 14 commits intoOct 26, 2026
Merged
Conversation
This reverts commit 489f656.
….com/Particular/Particular.PlatformSample into report-platform-tool-startup-failure
When a tool fails to start, Launch() prints the error and returns normally, so the launcher process still exits with code 0. A script, CI job or IDE can't tell that startup failed. Set Environment.ExitCode to 1 on that path. This doesn't throw, because the samples call Launch() without a try/catch: an exception would add an unhandled-exception stack trace on top of the error that was just printed, without telling the user anything new.
The error output is only captured while the tool output is hidden. With showPlatformToolConsoleOutput enabled, or when a tool exits without writing to stderr, the launcher printed "<tool> failed to start:" followed by an empty line. Include the exit code in the message, and when nothing was captured, point to the console output above and the .logs folder instead.
Pressing Ctrl+C (or cancelling the token passed to Launch()) during "Waiting for ServiceControl to be available" crashed the launcher with an unhandled TaskCanceledException, because WaitForHttpOk lets the cancellation exception escape. This was already the case before this PR, but the PR touches this block, so it's a cheap fix. Catch OperationCanceledException when the launcher's token was cancelled, the same way the "Press Ctrl+C" wait below already does, so the launcher continues to the normal shutdown path.
Base automatically changed from
report-platform-tool-startup-failure
to
master
October 26, 2026 16:10
soujay
approved these changes
Oct 26, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Suggested follow-ups from the review, one per commit:
Environment.ExitCode = 1when a tool fails to start, so scripts and IDEs can detect it. It doesn't throw, because the samples don't catch exceptions fromLaunch()..logsfolder instead of printing an empty line.TaskCanceledException. This crash also happens on master.Tested on macOS with a missing runtime (tool output hidden and shown), and with Ctrl+C both during the wait and after startup.