Support standalone mode for framework functions

This commit is contained in:
Phillip Wittrock
2020-11-12 08:53:14 -08:00
parent 5557e1ff3c
commit 8b9d8a266d
14 changed files with 486 additions and 5 deletions

View File

@@ -30,3 +30,11 @@ func WrapPrefixf(err interface{}, msg string, args ...interface{}) error {
func Errorf(msg string, args ...interface{}) error {
return goerrors.Wrap(fmt.Errorf(msg, args...), 1)
}
// GetStack returns a stack trace for the error if it has one
func GetStack(err error) string {
if e, ok := err.(*goerrors.Error); ok {
return string(e.Stack())
}
return ""
}