mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
utils: changeErrorType also copy params
This commit is contained in:
1 parent
2a4169d02b
commit
0476e6a4b1
3 files changed
+5
-3
No files matched your search
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user