1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-11-25 22:12:08 +02:00

Fix panic for unauthorized response with nil error

This commit is contained in:
Rekha Mittal
2019-03-19 11:27:47 -07:00
committed by Andy Grunwald
parent cbab0bba29
commit 53c468062d
2 changed files with 22 additions and 0 deletions

View File

@@ -38,6 +38,9 @@ func NewJiraError(resp *Response, httpError error) error {
return errors.Wrap(err, httpError.Error())
}
} else {
if httpError == nil {
return fmt.Errorf("Got Response Status %s:%s", resp.Status, string(body))
}
return errors.Wrap(httpError, fmt.Sprintf("%s: %s", resp.Status, string(body)))
}