util: remove node_modules/ in errMsg

This commit is contained in:
undefined committed 2021-05-21 18:14:38 +08:00
1 parent 561c4d4175
commit cc6e623413
4 files changed
+11 -5

No files matched your search

+2
View File
@@ -270,6 +270,8 @@ export function errorMessage(err: Error | string) {
.replace(/\/.+\/@hydrooj\//g, '\\')
.replace(/[A-Z]:\\.+\\hydrooj\\/g, 'hydrooj\\')
.replace(/\/.+\/hydrooj\//g, 'hydrooj/')
.replace(/[A-Z]:\\.+\\node_modules\\/g, '')
.replace(/\/.+\/node_modules\//g, '')
.replace(/\\/g, '/');
if (typeof err === 'string') return parsed;
err.stack = parsed;