Skip to content

Commit

Permalink
feat: add wrap err with line
Browse files Browse the repository at this point in the history
  • Loading branch information
5lliot committed Dec 17, 2023
1 parent 075b051 commit 65d0baa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,7 @@ func DetectFuncAtStackN(n int) string {
return fmt.Sprintf(" %s:%d ", remainingPath[extraInd+1:], line)
}
}

func WrapErrWithLine(err error) error {
return fmt.Errorf("%s: %v", DetectFuncAtStackN(2), err)
}

0 comments on commit 65d0baa

Please sign in to comment.