mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-02 05:02:27 +08:00
chore(lint): fix no-explicit-any in export.ts
This commit is contained in:
parent
7feb38ffa1
commit
04f3b637f9
@ -37,11 +37,11 @@ function exportBranch(req: Request, res: Response) {
|
|||||||
} else {
|
} else {
|
||||||
throw new NotFoundError(`Unrecognized export format '${format}'`);
|
throw new NotFoundError(`Unrecognized export format '${format}'`);
|
||||||
}
|
}
|
||||||
} catch (e: any) {
|
} catch (e: unknown) {
|
||||||
const message = `Export failed with following error: '${e.message}'. More details might be in the logs.`;
|
const message = `Export failed with following error: '${(e instanceof Error) ? e.message : e}'. More details might be in the logs.`;
|
||||||
taskContext.reportError(message);
|
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);
|
res.setHeader("Content-Type", "text/plain").status(500).send(message);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user