forked from databricks/databricks-sql-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
err.go
35 lines (27 loc) · 773 Bytes
/
err.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package dbsql
import (
"github.com/pkg/errors"
)
var ErrNotImplemented = "databricks: not implemented"
var ErrTransactionsNotSupported = "databricks: transactions are not supported"
var ErrParametersNotSupported = "databricks: query parameters are not supported"
type stackTracer interface {
StackTrace() errors.StackTrace
}
// wraps an error and adds trace if not already present
func wrapErr(err error, msg string) error {
if _, ok := err.(stackTracer); ok {
return err
}
return errors.Wrap(err, msg)
}
// adds a stack trace if not already present
func wrapErrf(err error, format string, args ...interface{}) error {
if _, ok := err.(stackTracer); ok {
return err
}
return errors.Wrapf(err, format, args...)
}
type causer interface {
Cause() error
}