You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
674 B

3 years ago
package main
import (
"errs"
"fmt"
)
3 years ago
func printTrace (s errs.StackTrace) {
lf := s.Frames()
for i,f := range lf {
fmt.Printf("%d file %s line %d %s\n",i,f.File,f.LineNumber,f.FuncName)
}
3 years ago
}
3 years ago
func main() {
3 years ago
3 years ago
eA := errs.ErrCode("1")
3 years ago
eB := errs.ErrCode("2")//.ToErrTrace(0)
eC := eA.ToErrCause(eB.ToErrInfo(errs.ErrInfoWithCause(errs.ErrCode("--ARRROR---").ToErrInfo(errs.ErrInfoWithMessage("Mi Mensage"),errs.ErrInfoWithStackTrace(3)))))
eM := errs.NewErrInfo(eC,
3 years ago
//errs.ErrMetasWithCause(eB),
//errs.ErrInfoWithStackTrace(0),
errs.ErrInfoWithMessage("Esto es el mensaje"),
errs.ErrInfoWithInfo ("Informacion del error"))
3 years ago
3 years ago
fmt.Print(eM.String())
3 years ago
3 years ago
}

Powered by TurnKey Linux.