-
Notifications
You must be signed in to change notification settings - Fork 80
/
errors.go
58 lines (55 loc) · 1.5 KB
/
errors.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
package egl
import "errors"
func Error() error {
switch GetError() {
case Success:
return nil
case NotInitialized:
return ErrNotInitialized
case BadAccess:
return ErrBadAccess
case BadAlloc:
return ErrBadAlloc
case BadAttribute:
return ErrBadAttribute
case BadConfig:
return ErrBadConfig
case BadContext:
return ErrBadContext
case BadCurrentSurface:
return ErrBadCurrentSurface
case BadDisplay:
return ErrBadDisplay
case BadMatch:
return ErrBadMatch
case BadNativePixmap:
return ErrBadNativePixmap
case BadNativeWindow:
return ErrBadNativeWindow
case BadParameter:
return ErrBadParameter
case BadSurface:
return ErrBadSurface
case ContextLost:
return ErrContextLost
default:
return ErrUnknown
}
}
var (
ErrUnknown = errors.New("unknown error")
ErrNotInitialized = errors.New("not initialized")
ErrBadAccess = errors.New("bad access")
ErrBadAlloc = errors.New("bad alloc")
ErrBadAttribute = errors.New("bad attribute")
ErrBadConfig = errors.New("bad config")
ErrBadContext = errors.New("bad context")
ErrBadCurrentSurface = errors.New("bad current surface")
ErrBadDisplay = errors.New("bad display")
ErrBadMatch = errors.New("bad match")
ErrBadNativePixmap = errors.New("bad native pixmap")
ErrBadNativeWindow = errors.New("bad native window")
ErrBadParameter = errors.New("bad parameter")
ErrBadSurface = errors.New("bad surface")
ErrContextLost = errors.New("context lost")
)