示例#1
0
文件: httperr.go 项目: convox/rack
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
}
示例#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...)
}