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 {
411
411
arguments : [ queryArgs ] ,
412
412
} ;
413
413
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
+ } ) ;
420
423
421
424
return queryPromise ;
422
425
} else {
Original file line number Diff line number Diff line change @@ -171,7 +171,15 @@ export async function getHarnessDir() {
171
171
/**
172
172
* default to gnattest/harness if Harness_Dir is unspecified
173
173
*/
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
+ } ,
175
183
)
176
184
. then ( async ( value ) => path . join ( await adaExtState . getObjectDir ( ) , value as string ) ) ;
177
185
}
You can’t perform that action at this time.
0 commit comments