/trace

Package for error handling and error reporting

Primary LanguageGoApache License 2.0Apache-2.0

Trace

GoDoc Test workflow

Package for error handling and error reporting

Read more here:

https://goteleport.com/blog/golang-error-handling/

Capture file, line and function

import (
     "github.com/gravitational/trace"
)

func someFunc() error {
   return trace.Wrap(err)
}


func main() {
  err := someFunc()
  fmt.Println(err.Error()) // prints file, line and function
}