Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error logging to RequestContext #71366

Merged
merged 6 commits into from
Jan 9, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.CodeAnalysis.Features.Workspaces;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CommonLanguageServerProtocol.Framework;
Expand Down Expand Up @@ -280,9 +281,11 @@ public static async Task<RequestContext> CreateAsync(
(workspace, solution) = await lspWorkspaceManager.GetLspSolutionInfoAsync(cancellationToken).ConfigureAwait(false);
}

if (workspace is null)
if (workspace is null || solution is null)
{
logger.LogError($"Could not find appropriate workspace for operation {workspace} on {method}");
akhera99 marked this conversation as resolved.
Show resolved Hide resolved
FatalError.ReportWithDumpAndCatch(new Exception(
$"Could not find appropriate workspace or solution on {method}"), ErrorSeverity.Critical);
}

context = new RequestContext(
Expand Down
Loading