mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-06-23 00:07:40 +02:00
Added the first go code
This commit is contained in:
19
errors.go
Normal file
19
errors.go
Normal file
@ -0,0 +1,19 @@
|
||||
package jira
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ErrorResponse reports one or more errors caused by an API request.
|
||||
type ErrorResponse struct {
|
||||
Response *http.Response // HTTP response that caused this error
|
||||
ErrorMessages []string `json:"errorMessages,omitempty"`
|
||||
Errors map[string]string `json:"errors,omitempty"`
|
||||
}
|
||||
|
||||
func (r *ErrorResponse) Error() string {
|
||||
return fmt.Sprintf("%v %v: %d %v %+v",
|
||||
r.Response.Request.Method, r.Response.Request.URL,
|
||||
r.Response.StatusCode, r.ErrorMessages, r.Errors)
|
||||
}
|
Reference in New Issue
Block a user