Skip to content
Merged
Changes from all 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 @@ -172,8 +172,8 @@ export class PromptValidator {
const loc = this.labelService.getUriLabel(resolved);
report(toMarker(localize('promptValidator.fileNotFound', "File '{0}' not found at '{1}'.", ref.content, loc), ref.range, MarkerSeverity.Warning));
}
} catch {
this.logger.warn(`Error checking existence of file reference '${ref.content}' resolved to '${resolved.toString()}' in prompt file '${promptAST.uri.toString()}'`);
} 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}`);
Comment on lines +175 to +176
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.
}
})());
}
Expand Down
Loading