1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-06-23 00:07:40 +02:00

Fix #1: Add some unit tests

This commit is contained in:
Andy Grunwald
2016-03-26 21:23:12 +01:00
parent e6c43b46f6
commit 0feccadf8d
3 changed files with 330 additions and 3 deletions

View File

@ -13,7 +13,11 @@ type ErrorResponse struct {
}
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)
if r.Response == nil {
return fmt.Sprintf("%v %+v", r.ErrorMessages, r.Errors)
} else {
return fmt.Sprintf("%v %v: %d %v %+v",
r.Response.Request.Method, r.Response.Request.URL,
r.Response.StatusCode, r.ErrorMessages, r.Errors)
}
}