-
-
Notifications
You must be signed in to change notification settings - Fork 198
/
error.go
60 lines (46 loc) · 1.11 KB
/
error.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package postgis
import (
"errors"
"fmt"
)
var (
ErrNilLayer = errors.New("layer is nil")
)
type ErrLayerNotFound struct {
LayerName string
}
func (e ErrLayerNotFound) Error() string {
return fmt.Sprintf("postgis: layer (%v) not found ", e.LayerName)
}
type ErrInvalidSSLMode string
func (e ErrInvalidSSLMode) Error() string {
return fmt.Sprintf("postgis: invalid ssl mode (%v)", string(e))
}
type ErrUnclosedToken string
func (e ErrUnclosedToken) Error() string {
return fmt.Sprintf("postgis: unclosed token in (%v)", string(e))
}
type ErrGeomFieldNotFound struct {
GeomFieldName string
LayerName string
}
func (e ErrGeomFieldNotFound) Error() string {
return fmt.Sprintf("postgis: geom fieldname (%v) not found for layer (%v)", e.GeomFieldName, e.LayerName)
}
type ErrInvalidURI struct {
Err error
Msg string
}
func (e ErrInvalidURI) Error() string {
if e.Msg == "" {
if e.Err != nil {
return fmt.Sprintf("postgis: %v", e.Err.Error())
} else {
return "postgis: invalid uri"
}
}
return fmt.Sprintf("postgis: invalid uri (%v)", e.Msg)
}
func (e ErrInvalidURI) Unwrap() error {
return e.Err
}