utils: changeErrorType also copy params

pull/169/head
undefined 3 years ago
parent 2a4169d02b
commit 0476e6a4b1

@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.9.0",
"version": "2.9.1",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
@ -9,6 +9,7 @@
"@hydrooj/utils": "^1.0.14",
"axios": "^0.21.1",
"cac": "^6.7.3",
"esbuild": "^0.12.17",
"fs-extra": "^10.0.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",

@ -311,9 +311,10 @@ export function formatSeconds(_seconds = '0') {
);
}
export function changeErrorType(err: Error, Err: any) {
export function changeErrorType(err: any, Err: any) {
const e = new Err(err.message);
e.stack = err.stack;
if (err.params) e.params = err.params;
return e;
}

@ -1,6 +1,6 @@
{
"name": "@hydrooj/utils",
"version": "1.1.0",
"version": "1.1.1",
"description": "hydrooj utils",
"main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git",

Loading…
Cancel
Save