| 478 | // Run some code, but don't wait longer than a certain time period for the result |
| 479 | // as it may never come. Returns true if the operation completed. |
| 480 | private async raceIgnoringErrors(action: () => Promise<any>, timeoutMilliseconds = 250): Promise<boolean> { |
| 481 | try { |
| 482 | await this.withTimeout(action(), timeoutMilliseconds); |
| 483 | return true; |
| 484 | } catch (e) { |
| 485 | this.log(`Error while while waiting for action: ${e}`); |
| 486 | return false; |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | protected async terminateRequest( |
| 491 | response: DebugProtocol.TerminateResponse, |