| 776 | }; |
| 777 | |
| 778 | const retry = (retryError: Error) => { |
| 779 | if (crawl === watchmanCrawl) { |
| 780 | this._console.warn( |
| 781 | 'jest-haste-map: Watchman crawl failed. Retrying once with node ' + |
| 782 | 'crawler.\n' + |
| 783 | " Usually this happens when watchman isn't running. Create an " + |
| 784 | "empty `.watchmanconfig` file in your project's root folder or " + |
| 785 | 'initialize a git or hg repository in your project.\n' + |
| 786 | ` ${retryError}`, |
| 787 | ); |
| 788 | return nodeCrawl(crawlerOptions).catch(error => { |
| 789 | throw new Error( |
| 790 | 'Crawler retry failed:\n' + |
| 791 | ` Original error: ${retryError.message}\n` + |
| 792 | ` Retry error: ${error.message}\n`, |
| 793 | ); |
| 794 | }); |
| 795 | } |
| 796 | |
| 797 | throw retryError; |
| 798 | }; |
| 799 | |
| 800 | try { |
| 801 | return await crawl(crawlerOptions); |