fix: show actual parsing errors instead of "user denied" message #6029
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.
Fixes #6028
Problem
Commands with complex syntax (escaped quotes, special characters) were failing with a misleading "The user denied this operation" error without ever showing an approval prompt. The actual parsing/processing error was being swallowed and replaced with a generic denial message.
Solution
askApprovalfunction to catch and display actual parsing errorsparsingErrorresponse type to clearly indicate when errors occur during command parsingChanges
src/core/assistant-message/presentAssistantMessage.ts
cline.ask()call in a try-catch blockparsingErrorresponsesrc/core/prompts/responses.ts
parsingErrorresponse type with clear messaging that the error occurred before the approval dialog could be shownTesting
Important
Improves error handling in
presentAssistantMessage.tsto display actual parsing errors instead of misleading denial messages.askApprovalfunction inpresentAssistantMessage.tsnow catches and displays parsing errors instead of showing a generic denial message.parsingErrorresponse type inresponses.tsto indicate parsing issues clearly.cline.ask()in a try-catch block inpresentAssistantMessage.tsto handle and display errors properly.formatResponse.parsingErrorto provide detailed error messages.This description was created by
for 964ffa6. You can customize this summary. It will automatically update as commits are pushed.