// ErrorWithStackSkipWithExtrasAndContext asynchronously sends an error to Rollbar with the given
// severity level and a given number of stack trace frames skipped with extra custom data, within
// the given context.
185951
func ErrorWithStackSkipWithExtrasAndContext(ctx context.Context, level string, err error, skip int, extras map[string]interface{}) {
	std.ErrorWithStackSkipWithExtrasAndContext(ctx, level, err, skip, extras)
}
284952
func InvalidInstanceContextErrorf(baseError error, obj interface{}, msgFormat string, args ...interface{}) *ErrorWithContext {
	return ContextualizeErrorf(baseError, InvalidInstanceErrorf(obj, msgFormat, args...).Error())
}
1150412
func LogPanicWithStack(log Interface, location string, r interface{}, vals ...interface{}) error {
	if log == nil {
		log = internal
	}
	var err error
	switch t := r.(type) {
	case string:
		err = errors.New(t)
	case error:
		err = t
	default:
		err = errors.Errorf("unkown type(%T) error: %v", r, r)
	}
	os.Mkdir("panics", os.ModePerm)
	b, tmpErr := ioutil.TempFile("panics", location)
	if tmpErr != nil {
		log.Log("event", "panic", "location", location, "err", err, "warning", "no temp file", "tmperr", tmpErr)
		return errors.Wrapf(tmpErr, "LogPanic: failed to create httpRecovery log")
	}

	fmt.Fprintf(b, "warning! %s!\nError:\n%+v\n", location, err)
	for i, v := range vals {
		spew.Fdump(b, "val(%d): %#v\n", i, v)
	}
	fmt.Fprintf(b, "\n\nCall Stack:\n%s", debug.Stack())

	log.Log("event", "panic", "location", location, "panicLog", b.Name())
	fmt.Fprintf(os.Stderr, "panicWithStack: wrote %s\n", b.Name())

	return errors.Wrap(b.Close(), "LogPanic: failed to close dump file")
}
901596
func (c *Client) RequestErrorWithExtrasAndContext(ctx context.Context, level string, r *http.Request, err error, extras map[string]interface{}) {
	c.RequestErrorWithStackSkipWithExtrasAndContext(ctx, level, r, err, 1, extras)
}
624882
func (c *Client) RequestErrorWithStackSkip(level string, r *http.Request, err error, skip int) {
	c.RequestErrorWithStackSkipWithExtras(level, r, err, skip, noExtras)
}
1231300
func (sc SigChain) GetExpectedNextHighSkip(mctx MetaContext, uid keybase1.UID) (HighSkip, error) {
	if sc.localChainNextHighSkipOverride != nil {
		return *sc.localChainNextHighSkipOverride, nil
	}
	if len(sc.chainLinks) == 0 {
		return NewInitialHighSkip(), nil
	}
	return sc.GetLastLink().ExpectedNextHighSkip(mctx, uid)
}
1003596
func RequestMessageWithExtrasAndContext(ctx context.Context, level string, r *http.Request, msg string, extras map[string]interface{}) {
	std.RequestMessageWithExtrasAndContext(ctx, level, r, msg, extras)
}
18455
func RenderStack(err error, excludePkgs ...string) []string {
	return renderStack(err).toLines(excludePkgs...)
}
413096
func MarshalStack(err error) interface{} {
	type stackTracer interface {
		StackTrace() errors.StackTrace
	}
	sterr, ok := err.(stackTracer)
	if !ok {
		return nil
	}
	st := sterr.StackTrace()
	s := &state{}
	out := make([]map[string]string, 0, len(st))
	for _, frame := range st {
		out = append(out, map[string]string{
			StackSourceFileName:     frameField(frame, s, 's'),
			StackSourceLineName:     frameField(frame, s, 'd'),
			StackSourceFunctionName: frameField(frame, s, 'n'),
		})
	}
	return out
}
1162127
func ErrorWithStack(val interface{}, skip ...int) *Error {
	if IsNil(val) {
		return nil
	}

	var err *Error
	switch v := val.(type) {
	case *Error:
		err = v.WithMsg() // must clone, should not change the origin *Error instance
	case error:
		err = ErrInternalServerError.From(v)
	case string:
		err = ErrInternalServerError.WithMsg(v)
	default:
		err = ErrInternalServerError.WithMsgf("%#v", v)
	}

	if err.Stack == "" {
		buf := make([]byte, 2048)
		buf = buf[:runtime.Stack(buf, false)]
		s := 1
		if len(skip) != 0 {
			s = skip[0]
		}
		err.Stack = pruneStack(buf, s)
	}
	return err
}
732194
func getStackTracer(err error) (stackTracer, bool) {
	var st stackTracer

	ForEachCause(err, func(err error) bool {
		if s, ok := err.(stackTracer); ok {
			st = s

			return false
		}

		return true
	})

	return st, st != nil
}
600630
func (self *Stack) ExportStack() (string, error) {

	url := "stack/" + self.Uuid + "/export/"
	request := "GET"
	//Empty Body Request
	body := []byte(`{}`)

	data, err := TutumCall(url, request, body)
	if err != nil {
		return "", err
	}

	s := string(data)

	return s, nil
}
80681
func GetErrorStack(err error) []error {
	if annotated, ok := err.(*annotatedError); ok {
		result := []error{}
		for _, a := range annotated.stack {
			if a.err != nil {
				result = append(result, a.err)
			}
		}
		return result
	}
	return []error{err}
}
999745
func (c *Client) MessageWithExtras(level string, msg string, extras map[string]interface{}) {
	c.MessageWithExtrasAndContext(context.TODO(), level, msg, extras)
}
1013610
func (obj *Global) GetDatabasesFromConnectionStringRaw(ctx context.Context, connection interface{}) (json.RawMessage, error) {
	result := &struct {
		Databases json.RawMessage	`json:"qDatabases"`
	} {}
	err := obj.rpc(ctx, "GetDatabasesFromConnectionString", result, ensureEncodable(connection))
	return result.Databases, err 
}
674366
func ErrorWithStackSkip(level string, err error, skip int) {
	std.ErrorWithStackSkip(level, err, skip)
}
371418
func WithMessagef(e error, format string, a ...interface{}) Error {
	if e == nil {
		return nil
	}
	return WrapSkipping(e, 1).WithMessagef(format, a...)
}