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 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "2.26.22", "version": "2.26.23",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "dist/loader.js", "main": "dist/loader.js",
"typings": "dist/loader.d.ts", "typings": "dist/loader.d.ts",
@@ -11,7 +11,7 @@
"node": ">=14" "node": ">=14"
}, },
"dependencies": { "dependencies": {
"@hydrooj/utils": "^1.0.16", "@hydrooj/utils": "^1.0.17",
"adm-zip": "^0.5.5", "adm-zip": "^0.5.5",
"ansi_up": "^5.0.1", "ansi_up": "^5.0.1",
"cookies": "^0.8.0", "cookies": "^0.8.0",
+6 -2
View File
@@ -1,10 +1,14 @@
/* eslint-disable no-empty-function */ /* eslint-disable no-empty-function */
/* eslint-disable class-methods-use-this */ /* eslint-disable class-methods-use-this */
import { NotFoundError } from '../error'; import { NotFoundError } from '../error';
import { Route, Handler } from '../service/server'; import {
Route, Handler, param, Types,
} from '../service/server';
class NotFoundHandler extends Handler { class NotFoundHandler extends Handler {
prepare() { @param('bsod', Types.Boolean)
prepare(domainId: string, bsod: boolean) {
if (bsod) throw new Error(this.request.path);
throw new NotFoundError(this.request.path); throw new NotFoundError(this.request.path);
} }
+2
View File
@@ -270,6 +270,8 @@ export function errorMessage(err: Error | string) {
.replace(/\/.+\/@hydrooj\//g, '\\') .replace(/\/.+\/@hydrooj\//g, '\\')
.replace(/[A-Z]:\\.+\\hydrooj\\/g, 'hydrooj\\') .replace(/[A-Z]:\\.+\\hydrooj\\/g, 'hydrooj\\')
.replace(/\/.+\/hydrooj\//g, 'hydrooj/') .replace(/\/.+\/hydrooj\//g, 'hydrooj/')
.replace(/[A-Z]:\\.+\\node_modules\\/g, '')
.replace(/\/.+\/node_modules\//g, '')
.replace(/\\/g, '/'); .replace(/\\/g, '/');
if (typeof err === 'string') return parsed; if (typeof err === 'string') return parsed;
err.stack = parsed; err.stack = parsed;
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/utils", "name": "@hydrooj/utils",
"version": "1.0.16", "version": "1.0.17",
"description": "hydrooj utils", "description": "hydrooj utils",
"main": "package.json", "main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",