Skip to content

Remove error reporting out of clasp and rely on host to report errors#82435

Merged
dibarbet merged 1 commit into
dotnet:mainfrom
dibarbet:fix_shutdown_nfw
Feb 18, 2026
Merged

Remove error reporting out of clasp and rely on host to report errors#82435
dibarbet merged 1 commit into
dotnet:mainfrom
dibarbet:fix_shutdown_nfw

Conversation

@dibarbet

Copy link
Copy Markdown
Member

Fixes issue found by @davidwengier where we can't use FatalError in clasp (used by Razor/Webtools who do not have that type).

Also fixes issue where if the server encountered a queue error in VS, it could not be restarted as restart would throw.

@dibarbet dibarbet requested a review from a team as a code owner February 17, 2026 21:24
var exceptionToReport = TryGetReportableException(e);
if (exceptionToReport != null)
{
FatalError.ReportNonFatalError(exceptionToReport, ErrorSeverity.Critical);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exception flows through to callers of WaitForExitAsync, and they handle it as needed

if (_shutdownRequestTask == null)
{
throw new InvalidOperationException("The language server has not yet been asked to shutdown.");
throw new ServerNotShutDownException("The language server has not yet been asked to shutdown.");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to allow callers to distinguish between an error calling waitforexitasync, and the error that caused the languageserver to shutdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants