1
0
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:
Andy Grunwald
2015-09-03 12:25:21 +02:00
parent 76e73f3252
commit e848968f58
4 changed files with 466 additions and 0 deletions

19
errors.go Normal file
View 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)
}