code: func NewJiraError(resp *Response, httpError error) error {
  	if resp == nil {
  		return errors.Wrap(httpError, "No response returned")
  	}
  
  	defer resp.Body.Close()
  	body, err := ioutil.ReadAll(resp.Body)
  	if err != nil {
  		return errors.Wrap(err, httpError.Error())
  	}
  	jerr := Error{HTTPError: httpError}
  	contentType := resp.Header.Get("Content-Type")
  	if strings.HasPrefix(contentType, "application/json") {
  		err = json.Unmarshal(body, &jerr)
  		if err != nil {
  			httpError = errors.Wrap(errors.New("Could not parse JSON"), httpError.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)))
  	}
  
  	return &jerr
  }
docs: // NewJiraError creates a new jira Error