We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 07504b5 + ac9ef6d commit e68b545Copy full SHA for e68b545
zendesk/error.go
@@ -14,6 +14,16 @@ type Error struct {
14
resp *http.Response
15
}
16
17
+// NewError is a function to initialize the Error type. This function will be useful
18
+// for unit testing and mocking purposes in the client side
19
+// to test their behavior by the API response.
20
+func NewError(body []byte, resp *http.Response) *Error {
21
+ return &Error{
22
+ body: body,
23
+ resp: resp,
24
+ }
25
+}
26
+
27
// Error the error string for this error
28
func (e Error) Error() string {
29
msg := string(e.body)
0 commit comments