File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/amazonq/src/lsp/chat Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -249,11 +249,16 @@ export function registerMessageListeners(
249249 } catch ( e ) {
250250 languageClient . info ( `Error occurred during chat request: ${ e } ` )
251251 // Use the last partial result if available, append error message
252+ let body = ''
253+ if ( ! cancellationToken . token . isCancellationRequested ) {
254+ body = lastPartialResult ?. body
255+ ? `${ lastPartialResult . body } \n\n ❌ Error: Request failed to complete`
256+ : '❌ An error occurred while processing your request'
257+ }
258+
252259 const errorResult : ChatResult = {
253260 ...lastPartialResult ,
254- body : lastPartialResult ?. body
255- ? `${ lastPartialResult . body } \n\n ❌ Error: Request failed to complete`
256- : '❌ An error occurred while processing your request' ,
261+ body,
257262 }
258263
259264 await handleCompleteResult < ChatResult > (
You can’t perform that action at this time.
0 commit comments