utils: changeErrorType also copy params

This commit is contained in:
undefined committed 2021-07-30 17:00:28 +08:00
1 parent 2a4169d02b
commit 0476e6a4b1
3 files changed
+5 -3

No files matched your search

+2 -1
View File
@@ -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 -1
View File
@@ -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",