Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates PromptValidator’s file-reference validation to include caught error details in the warning log, improving diagnosability when file existence checks fail.
Changes:
- Capture the thrown error in the
fileService.existstry/catch. - Include the error’s message in the warning log to provide more context.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.ts | Enhances warning logs during file reference existence checks by appending error details. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
Comment on lines
+141
to
+142
| } catch (e) { | ||
| this.logger.warn(`Error checking existence of file reference '${ref.content}' resolved to '${resolved.toString()}' in prompt file '${promptAST.uri.toString()}': ${e.message}`); |
There was a problem hiding this comment.
In this catch block, interpolating ${e.message} assumes the thrown value has a message property; if something throws null/undefined this will itself throw while handling the error, and for non-Error throws it may log undefined and lose stack details. Prefer using the existing toErrorMessage(e, true) helper (or otherwise safely stringify the caught value) so logging is robust and includes useful diagnostics.
Contributor
|
Base:
|
alexr00
approved these changes
Apr 22, 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.
Co-authored-by: Copilot copilot@github.com