Skip to content

Build your personal knowledge base with Trilium Notes

chore(lint): fix no-explicit-any in export.ts

Panagiotis Papadopoulos04f3b637f94b
diff --git a/src/routes/api/export.ts b/src/routes/api/export.ts
index 9023125f9e..5aa072a751 100644
--- a/src/routes/api/export.ts
+++ b/src/routes/api/export.ts
@@ -37,11 +37,11 @@ function exportBranch(req: Request, res: Response) {
} else {
throw new NotFoundError(`Unrecognized export format '${format}'`);
}
- } catch (e: any) {
- const message = `Export failed with following error: '${e.message}'. More details might be in the logs.`;
+ } catch (e: unknown) {
+ const message = `Export failed with following error: '${(e instanceof Error) ? e.message : e}'. More details might be in the logs.`;
taskContext.reportError(message);
- log.error(message + e.stack);
+ log.error((e instanceof Error) ? message + e.stack : message);
res.setHeader("Content-Type", "text/plain").status(500).send(message);
}