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.
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"errs"
|
|
|
|
|
"fmt"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
|
|
|
|
|
eA := errs.ErrCode("1")
|
|
|
|
|
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,
|
|
|
|
|
//errs.ErrMetasWithCause(eB),
|
|
|
|
|
//errs.ErrInfoWithStackTrace(0),
|
|
|
|
|
errs.ErrInfoWithMessage("Esto es el mensaje"),
|
|
|
|
|
errs.ErrInfoWithInfo ("Informacion del error"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fmt.Print(eM.String())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|