Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Oct 30, 2024
1 parent a1c349d commit 218c979
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions exception/catchException.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package exception

import (
"fmt"

"github.com/farseer-go/fs/trace"
)

Expand All @@ -10,8 +11,8 @@ type catchException struct {
}

// TryCatch 异常时返回error
func TryCatch(fn func()) error{
var err error
func TryCatch(fn func()) error {
var err error
Try(fn).CatchException(func(exp any) {
err = fmt.Errorf("%+v", exp)
})
Expand Down

0 comments on commit 218c979

Please sign in to comment.