Ejemplo n.º 1
0
func New(code int, err error) *Error {
	if err == nil {
		return nil
	}

	e := &Error{
		code:  code,
		err:   err,
		stack: rollbar.BuildStack(3),
		trace: errorTrace(),
	}

	return e
}
Ejemplo n.º 2
0
// BuildStackWithSkip concatenates the stack given by the current execution flow
// and the stack determined by the errgo error
func BuildStackWithSkip(err error, skip int) rollbar.Stack {
	errStack := BuildStack(err)
	execStack := rollbar.BuildStack(skip + 2)
	return append(errStack, execStack...)
}