mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17: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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user