File tree Expand file tree Collapse file tree 1 file changed +15
-23
lines changed
src/codewhisperer/service Expand file tree Collapse file tree 1 file changed +15
-23
lines changed Original file line number Diff line number Diff line change @@ -108,31 +108,23 @@ export class RecommendationHandler {
108
108
promise : Promise < any >
109
109
) : Promise < any > {
110
110
const timeoutMessage = isCloud9 ( ) ? `Generate recommendation timeout.` : `List recommendation timeout`
111
- try {
112
- if ( isManualTriggerOn && triggerType === 'OnDemand' && ( isCloud9 ( ) || isFirstPaginationCall ) ) {
113
- return vscode . window . withProgress (
114
- {
115
- location : vscode . ProgressLocation . Notification ,
116
- title : CodeWhispererConstants . pendingResponse ,
117
- cancellable : false ,
118
- } ,
119
- async ( ) => {
120
- return await asyncCallWithTimeout (
121
- promise ,
122
- timeoutMessage ,
123
- CodeWhispererConstants . promiseTimeoutLimit * 1000
124
- )
125
- }
126
- )
127
- }
128
- return await asyncCallWithTimeout (
129
- promise ,
130
- timeoutMessage ,
131
- CodeWhispererConstants . promiseTimeoutLimit * 1000
111
+ if ( isManualTriggerOn && triggerType === 'OnDemand' && ( isCloud9 ( ) || isFirstPaginationCall ) ) {
112
+ return vscode . window . withProgress (
113
+ {
114
+ location : vscode . ProgressLocation . Notification ,
115
+ title : CodeWhispererConstants . pendingResponse ,
116
+ cancellable : false ,
117
+ } ,
118
+ async ( ) => {
119
+ return await asyncCallWithTimeout (
120
+ promise ,
121
+ timeoutMessage ,
122
+ CodeWhispererConstants . promiseTimeoutLimit * 1000
123
+ )
124
+ }
132
125
)
133
- } catch ( error ) {
134
- throw new Error ( `${ error instanceof Error ? error . message : error } ` )
135
126
}
127
+ return await asyncCallWithTimeout ( promise , timeoutMessage , CodeWhispererConstants . promiseTimeoutLimit * 1000 )
136
128
}
137
129
138
130
async getTaskTypeFromEditorFileName ( filePath : string ) : Promise < CodewhispererGettingStartedTask | undefined > {
You can’t perform that action at this time.
0 commit comments