Skip to content

promptValidator: log error#311899

Merged
aeschli merged 2 commits intomainfrom
aeschli/ltd-cricket-358
Apr 26, 2026
Merged

promptValidator: log error#311899
aeschli merged 2 commits intomainfrom
aeschli/ltd-cricket-358

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Apr 22, 2026

Co-authored-by: Copilot copilot@github.com

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 22, 2026 13:06
@aeschli aeschli enabled auto-merge (squash) April 22, 2026 13:06
@aeschli aeschli self-assigned this Apr 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.exists try/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}`);
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

Base: bccdfa8b Current: a585f2b0

No screenshot changes.

@aeschli aeschli merged commit fe0c770 into main Apr 26, 2026
26 checks passed
@aeschli aeschli deleted the aeschli/ltd-cricket-358 branch April 26, 2026 19:42
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants