diff --git a/server/src/utils/config.ts b/server/src/utils/config.ts index a6073471d1..67a10e88b6 100644 --- a/server/src/utils/config.ts +++ b/server/src/utils/config.ts @@ -67,7 +67,7 @@ const loadFromFile = async ({ metadataRepo, logger }: RepoDeps, filepath: string try { const file = await metadataRepo.readFile(filepath); return loadYaml(file) as unknown; - } catch (error: Error | any) { + } catch (error: unknown) { logger.error(`Unable to load configuration file: ${filepath}`); logger.error(error); throw error; diff --git a/server/src/utils/file.ts b/server/src/utils/file.ts index 24d555f2fe..e0abe45f1f 100644 --- a/server/src/utils/file.ts +++ b/server/src/utils/file.ts @@ -71,7 +71,7 @@ export const sendFile = async ( } return await _sendFile(file.path, { dotfiles: 'allow' }); - } catch (error: Error | any) { + } catch (error: unknown) { // ignore client-closed connection if (isConnectionAborted(error) || res.headersSent) { return; @@ -79,7 +79,7 @@ export const sendFile = async ( // log non-http errors if (!(error instanceof HttpException)) { - logger.error(`Unable to send file: ${error}`, error.stack); + logger.error(`Unable to send file: ${error}`, (error as Error).stack); } next(new NotFoundException());