Skip to content

Commit

Permalink
Custom Commands: Show context command errors in the notification mess…
Browse files Browse the repository at this point in the history
…age for easier debugging (#3565)
  • Loading branch information
toolmantim authored Mar 27, 2024
1 parent a88b9cf commit 5c22d71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This is a log of all notable changes to Cody for VS Code. [Unreleased] changes a
- Chat: Large file cannot be added via @-mention. [pull/3531](https://github.com/sourcegraph/cody/pull/3531)
- Chat: Handle empty chat message input and prevent submission of empty messages. [pull/3554](https://github.com/sourcegraph/cody/pull/3554)
- Chat: Warnings are now displayed correctly for large files in the @-mention file selection list. [pull/3526](https://github.com/sourcegraph/cody/pull/3526)
- Custom Commands: Errors when running context command scripts now show the error output in the notification message. [pull/3565](https://github.com/sourcegraph/cody/pull/3565)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion vscode/src/commands/context/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export async function getContextFileFromShell(command: string): Promise<ContextI
} catch (error) {
// Handles errors and empty output
logError('getContextFileFromShell', 'failed', { verbose: error })
void vscode.window.showErrorMessage('Command Failed: Make sure the command works locally.')
void vscode.window.showErrorMessage((error as Error).message)
throw new Error('Failed to get shell output for Custom Command.')
}
})
Expand Down

0 comments on commit 5c22d71

Please sign in to comment.