utils: errorMessage: filter unuseful lines [skip-cache]

This commit is contained in:
undefined committed 2022-10-04 22:56:22 +08:00
1 parent 1c128f85c5
commit 6cea9eb51c
2 files changed
+4 -7

No files matched your search

+3
View File
@@ -162,6 +162,9 @@ export namespace Time {
export function errorMessage(err: Error | string) {
const t = typeof err === 'string' ? err : err.stack;
const parsed = t
.split('\n')
.filter((i) => !i.includes(' (node:'))
.join('\n')
.replace(/[A-Z]:\\.+\\@hydrooj\\/g, '@hydrooj\\')
.replace(/\/.+\/@hydrooj\//g, '\\')
.replace(/[A-Z]:\\.+\\hydrooj\\/g, 'hydrooj\\')