rewrite checkpoint

This commit is contained in:
Cory Bennett
2017-08-13 18:23:38 -07:00
parent b00021ccbd
commit 36632a52f0
883 changed files with 222856 additions and 2972 deletions
+19
View File
@@ -0,0 +1,19 @@
package jira
import (
"fmt"
"net/http"
"gopkg.in/Netflix-Skunkworks/go-jira.v1/jiradata"
)
func responseError(resp *http.Response) error {
results := &jiradata.ErrorCollection{}
if err := readJSON(resp.Body, results); err != nil {
return err
}
if len(results.ErrorMessages) == 0 && len(results.Errors) == 0 {
return fmt.Errorf(resp.Status)
}
return results
}