Add clarity to error messages (#14879)

This commit is contained in:
Gaurav Sehgal
2025-12-13 06:31:12 +05:30
committed by GitHub
parent ad60cbfc2c
commit d9f94103cd
5 changed files with 88 additions and 54 deletions
+3 -3
View File
@@ -230,7 +230,7 @@ export async function runNonInteractive({
}
if (!query) {
const { processedQuery, shouldProceed } = await handleAtCommand({
const { processedQuery, error } = await handleAtCommand({
query: input,
config,
addItem: (_item, _timestamp) => 0,
@@ -239,11 +239,11 @@ export async function runNonInteractive({
signal: abortController.signal,
});
if (!shouldProceed || !processedQuery) {
if (error || !processedQuery) {
// An error occurred during @include processing (e.g., file not found).
// The error message is already logged by handleAtCommand.
throw new FatalInputError(
'Exiting due to an error processing the @ command.',
error || 'Exiting due to an error processing the @ command.',
);
}
query = processedQuery as Part[];