2023-07-21 13:20:44 +02:00
|
|
|
package errfmt
|
|
|
|
|
|
|
|
|
|
import (
|
2026-05-09 01:43:14 +00:00
|
|
|
"github.com/Gleipnir-Technology/jet/internal/utils/is"
|
2023-07-21 13:20:44 +02:00
|
|
|
"strings"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Trace returns well formatted wrapped error trace string
|
|
|
|
|
func Trace(err error) string {
|
2023-07-21 17:10:39 +02:00
|
|
|
if is.Nil(err) {
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2023-07-21 13:20:44 +02:00
|
|
|
return "Error trace:\n" + " - " + strings.Replace(err.Error(), ": ", ":\n - ", -1)
|
|
|
|
|
}
|