Skip to content

Commit

Permalink
Fix some new ts errors/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jneira committed Oct 13, 2021
1 parent 1550d44 commit 94d146c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/docsBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export namespace DocsBrowser {
</body>
</html>
`;
} catch (e) {
} catch (e: any) {
await window.showErrorMessage(e);
}
return panel;
Expand All @@ -89,7 +89,7 @@ export namespace DocsBrowser {
if (inWebView) {
await commands.executeCommand('workbench.action.closeActiveEditor');
}
} catch (e) {
} catch (e: any) {
await window.showErrorMessage(e);
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/hlsBinaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,21 +211,21 @@ async function getLatestReleaseMetadata(context: ExtensionContext, storagePath:
: undefined;
const opts: https.RequestOptions = releasesUrl
? {
host: releasesUrl.host,
path: releasesUrl.path,
}
host: releasesUrl.host,
path: releasesUrl.path,
}
: {
host: 'api.github.com',
path: '/repos/haskell/haskell-language-server/releases',
};
host: 'api.github.com',
path: '/repos/haskell/haskell-language-server/releases',
};

const offlineCache = path.join(storagePath, 'latestApprovedRelease.cache.json');

async function readCachedReleaseData(): Promise<IRelease | null> {
try {
const cachedInfo = await promisify(fs.readFile)(offlineCache, { encoding: 'utf-8' });
return validate.parseAndValidate(cachedInfo, cachedReleaseValidator);
} catch (err) {
} catch (err: any) {
// If file doesn't exist, return null, otherwise consider it a failure
if (err.code === 'ENOENT') {
return null;
Expand Down Expand Up @@ -268,7 +268,7 @@ async function getLatestReleaseMetadata(context: ExtensionContext, storagePath:
// Cache the latest successfully fetched release information
await promisify(fs.writeFile)(offlineCache, JSON.stringify(latestInfoParsed), { encoding: 'utf-8' });
return latestInfoParsed;
} catch (githubError) {
} catch (githubError: any) {
// Attempt to read from the latest cached file
try {
const cachedInfoParsed = await readCachedReleaseData();
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export async function downloadFile(titleMsg: string, src: string, dest: string):
inFlightDownloads.set(src, new Map([[dest, downloadTask]]));
}
return await downloadTask;
} catch (e) {
} catch (e: any) {
await promisify(fs.unlink)(downloadDest).catch(ignoreFileNotExists);
throw new Error(`Failed to download ${src}:\n${e.message}`);
}
Expand Down

0 comments on commit 94d146c

Please sign in to comment.