File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
integration/vscode/ada/src Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -411,12 +411,15 @@ export class ExtensionState {
411411 arguments : [ queryArgs ] ,
412412 } ;
413413
414- const queryPromise = this . adaClient . sendRequest (
415- ExecuteCommandRequest . type ,
416- params ,
417- ) as Promise < string | string [ ] > ;
418-
419- this . projectAttributeCache . set ( mapKey , queryPromise ) ;
414+ const queryPromise = this . adaClient
415+ . sendRequest ( ExecuteCommandRequest . type , params )
416+ . then ( ( value ) => {
417+ /**
418+ * Only cache the promise if it was fulfilled.
419+ */
420+ this . projectAttributeCache . set ( mapKey , queryPromise ) ;
421+ return value as string | string [ ] ;
422+ } ) ;
420423
421424 return queryPromise ;
422425 } else {
Original file line number Diff line number Diff line change @@ -171,7 +171,15 @@ export async function getHarnessDir() {
171171 /**
172172 * default to gnattest/harness if Harness_Dir is unspecified
173173 */
174- ( ) => path . join ( 'gnattest' , 'harness' ) ,
174+ ( err ) => {
175+ if ( err instanceof Error && err . message == 'The queried attribute is not known' ) {
176+ return path . join ( 'gnattest' , 'harness' ) ;
177+ } else {
178+ // Reject the promise with the same error.
179+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
180+ return Promise . reject ( err ) ;
181+ }
182+ } ,
175183 )
176184 . then ( async ( value ) => path . join ( await adaExtState . getObjectDir ( ) , value as string ) ) ;
177185}
You can’t perform that action at this time.
0 commit comments