code: func CheckResponse(r *http.Response) error {
  	if c := r.StatusCode; 200 <= c && c <= 299 {
  		return nil
  	}
  
  	err := fmt.Errorf("Request failed. Please analyze the request body for more details. Status code: %d", r.StatusCode)
  	return err
  }
docs: // CheckResponse checks the API response for errors, and returns them if present.
  // A response is considered an error if it has a status code outside the 200 range.
  // The caller is responsible to analyze the response body.
  // The body can contain JSON (if the error is intended) or xml (sometimes JIRA just failes).