mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(package): [promise] recover a panic after the promise settled (#420)
* fix(package): [promise] recover a panic after the promise settled * test(package): [promise] cover a panic after the promise settled --------- Co-authored-by: DuDaoDong <dudaodong@gmail.com>
This commit is contained in:
1 parent
ed237c18b3
commit
d561d4da77
1 file changed
-4
@@ -49,10 +49,6 @@ func (p *Promise[T]) run() {
|
||||
|
||||
go func() {
|
||||
defer func() {
|
||||
if !p.pending {
|
||||
return
|
||||
}
|
||||
|
||||
if err := recover(); err != nil {
|
||||
p.reject(errors.New(fmt.Sprint(err)))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user