2023-07-21 13:20:44 +02:00
|
|
|
package errfmt
|
|
|
|
|
|
|
|
|
|
import (
|
2026-05-14 16:26:47 +00:00
|
|
|
"source.gleipnir.technology/Gleipnir/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)
|
|
|
|
|
}
|