-
Notifications
You must be signed in to change notification settings - Fork 21
/
exception_type.go
147 lines (141 loc) · 7.17 KB
/
exception_type.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
package gmagick
/*
#include <wand/wand_api.h>
*/
import "C"
import (
"fmt"
)
type ExceptionType int
const (
EXCEPTION_UNDEFINED ExceptionType = C.UndefinedException
EXCEPTION_WARNING ExceptionType = C.WarningException
WARNING_RESOURCE_LIMIT ExceptionType = C.ResourceLimitWarning
WARNING_TYPE ExceptionType = C.TypeWarning
WARNING_OPTION ExceptionType = C.OptionWarning
WARNING_DELEGATE ExceptionType = C.DelegateWarning
WARNING_MISSING_DELEGATE ExceptionType = C.MissingDelegateWarning
WARNING_CORRUPT_IMAGE ExceptionType = C.CorruptImageWarning
WARNING_FILE_OPEN ExceptionType = C.FileOpenWarning
WARNING_BLOB ExceptionType = C.BlobWarning
WARNING_STREAM ExceptionType = C.StreamWarning
WARNING_CACHE ExceptionType = C.CacheWarning
WARNING_CODER ExceptionType = C.CoderWarning
WARNING_MODULE ExceptionType = C.ModuleWarning
WARNING_DRAW ExceptionType = C.DrawWarning
WARNING_IMAGE ExceptionType = C.ImageWarning
WARNING_WAND ExceptionType = C.WandWarning
WARNING_XSERVER ExceptionType = C.XServerWarning
WARNING_MONITOR ExceptionType = C.MonitorWarning
WARNING_REGISTRY ExceptionType = C.RegistryWarning
WARNING_CONFIGURE ExceptionType = C.ConfigureWarning
EXCEPTION_ERROR ExceptionType = C.ErrorException
ERROR_RESOURCE_LIMIT ExceptionType = C.ResourceLimitError
ERROR_TYPE ExceptionType = C.TypeError
ERROR_OPTION ExceptionType = C.OptionError
ERROR_DELEGATE ExceptionType = C.DelegateError
ERROR_MISSING_DELEGATE ExceptionType = C.MissingDelegateError
ERROR_CORRUPT_IMAGE ExceptionType = C.CorruptImageError
ERROR_FILE_OPEN ExceptionType = C.FileOpenError
ERROR_BLOB ExceptionType = C.BlobError
ERROR_STREAM ExceptionType = C.StreamError
ERROR_CACHE ExceptionType = C.CacheError
ERROR_CODER ExceptionType = C.CoderError
ERROR_MODULE ExceptionType = C.ModuleError
ERROR_DRAW ExceptionType = C.DrawError
ERROR_IMAGE ExceptionType = C.ImageError
ERROR_WAND ExceptionType = C.WandError
ERROR_XSERVER ExceptionType = C.XServerError
ERROR_MONITOR ExceptionType = C.MonitorError
ERROR_REGISTRY ExceptionType = C.RegistryError
ERROR_CONFIGURE ExceptionType = C.ConfigureError
EXCEPTION_FATAL_ERROR ExceptionType = C.FatalErrorException
FATAL_ERROR_RESOURCE_LIMIT ExceptionType = C.ResourceLimitFatalError
FATAL_ERROR_TYPE ExceptionType = C.TypeFatalError
FATAL_ERROR_OPTION ExceptionType = C.OptionFatalError
FATAL_ERROR_DELEGATE ExceptionType = C.DelegateFatalError
FATAL_ERROR_MISSING_DELEGATE ExceptionType = C.MissingDelegateFatalError
FATAL_ERROR_CORRUPT_IMAGE ExceptionType = C.CorruptImageFatalError
FATAL_ERROR_FILE_OPEN ExceptionType = C.FileOpenFatalError
FATAL_ERROR_BLOB ExceptionType = C.BlobFatalError
FATAL_ERROR_STREAM ExceptionType = C.StreamFatalError
FATAL_ERROR_CACHE ExceptionType = C.CacheFatalError
FATAL_ERROR_CODER ExceptionType = C.CoderFatalError
FATAL_ERROR_MODULE ExceptionType = C.ModuleFatalError
FATAL_ERROR_DRAW ExceptionType = C.DrawFatalError
FATAL_ERROR_IMAGE ExceptionType = C.ImageFatalError
FATAL_ERROR_WAND ExceptionType = C.WandFatalError
FATAL_ERROR_XSERVER ExceptionType = C.XServerFatalError
FATAL_ERROR_MONITOR ExceptionType = C.MonitorFatalError
FATAL_ERROR_REGISTRY ExceptionType = C.RegistryFatalError
FATAL_ERROR_CONFIGURE ExceptionType = C.ConfigureFatalError
)
var exceptionTypeStrings = map[ExceptionType]string{
EXCEPTION_UNDEFINED: "EXCEPTION_UNDEFINED",
EXCEPTION_WARNING: "EXCEPTION_WARNING",
WARNING_TYPE: "WARNING_TYPE",
WARNING_OPTION: "WARNING_OPTION",
WARNING_DELEGATE: "WARNING_DELEGATE",
WARNING_MISSING_DELEGATE: "WARNING_MISSING_DELEGATE",
WARNING_CORRUPT_IMAGE: "WARNING_CORRUPT_IMAGE",
WARNING_FILE_OPEN: "WARNING_FILE_OPEN",
WARNING_BLOB: "WARNING_BLOB",
WARNING_STREAM: "WARNING_STREAM",
WARNING_CACHE: "WARNING_CACHE",
WARNING_CODER: "WARNING_CODER",
WARNING_MODULE: "WARNING_MODULE",
WARNING_DRAW: "WARNING_DRAW",
WARNING_IMAGE: "WARNING_IMAGE",
WARNING_WAND: "WARNING_WAND",
WARNING_XSERVER: "WARNING_XSERVER",
WARNING_MONITOR: "WARNING_MONITOR",
WARNING_REGISTRY: "WARNING_REGISTRY",
WARNING_CONFIGURE: "WARNING_CONFIGURE",
EXCEPTION_ERROR: "EXCEPTION_ERROR",
ERROR_TYPE: "ERROR_TYPE",
ERROR_OPTION: "ERROR_OPTION",
ERROR_DELEGATE: "ERROR_DELEGATE",
ERROR_MISSING_DELEGATE: "ERROR_MISSING_DELEGATE",
ERROR_CORRUPT_IMAGE: "ERROR_CORRUPT_IMAGE",
ERROR_FILE_OPEN: "ERROR_FILE_OPEN",
ERROR_BLOB: "ERROR_BLOB",
ERROR_STREAM: "ERROR_STREAM",
ERROR_CACHE: "ERROR_CACHE",
ERROR_CODER: "ERROR_CODER",
ERROR_MODULE: "ERROR_MODULE",
ERROR_DRAW: "ERROR_DRAW",
ERROR_IMAGE: "ERROR_IMAGE",
ERROR_WAND: "ERROR_WAND",
ERROR_XSERVER: "ERROR_XSERVER",
ERROR_MONITOR: "ERROR_MONITOR",
ERROR_REGISTRY: "ERROR_REGISTRY",
ERROR_CONFIGURE: "ERROR_CONFIGURE",
EXCEPTION_FATAL_ERROR: "EXCEPTION_FATAL_ERROR",
FATAL_ERROR_TYPE: "FATAL_ERROR_TYPE",
FATAL_ERROR_OPTION: "FATAL_ERROR_OPTION",
FATAL_ERROR_DELEGATE: "FATAL_ERROR_DELEGATE",
FATAL_ERROR_MISSING_DELEGATE: "FATAL_ERROR_MISSING_DELEGATE",
FATAL_ERROR_CORRUPT_IMAGE: "FATAL_ERROR_CORRUPT_IMAGE",
FATAL_ERROR_FILE_OPEN: "FATAL_ERROR_FILE_OPEN",
FATAL_ERROR_BLOB: "FATAL_ERROR_BLOB",
FATAL_ERROR_STREAM: "FATAL_ERROR_STREAM",
FATAL_ERROR_CACHE: "FATAL_ERROR_CACHE",
FATAL_ERROR_CODER: "FATAL_ERROR_CODER",
FATAL_ERROR_MODULE: "FATAL_ERROR_MODULE",
FATAL_ERROR_DRAW: "FATAL_ERROR_DRAW",
FATAL_ERROR_IMAGE: "FATAL_ERROR_IMAGE",
FATAL_ERROR_WAND: "FATAL_ERROR_WAND",
FATAL_ERROR_XSERVER: "FATAL_ERROR_XSERVER",
FATAL_ERROR_MONITOR: "FATAL_ERROR_MONITOR",
FATAL_ERROR_REGISTRY: "FATAL_ERROR_REGISTRY",
FATAL_ERROR_CONFIGURE: "FATAL_ERROR_CONFIGURE",
//WARNING_RESOURCE_LIMIT: "WARNING_RESOURCE_LIMIT",
//ERROR_RESOURCE_LIMIT: "ERROR_RESOURCE_LIMIT",
//FATAL_ERROR_RESOURCE_LIMIT: "FATAL_ERROR_RESOURCE_LIMIT",
}
func (et *ExceptionType) String() string {
if v, ok := exceptionTypeStrings[ExceptionType(*et)]; ok {
return v
}
return fmt.Sprintf("UnknownError[%d]", *et)
}