+1 for logging any status code > 204

----- Original Message -----
From: "Clayton Coleman" <notifications@github.com>
To: "openshift/docker-source-to-images" <docker-source-to-images@noreply.github.com>
Cc: "Derek Carr" <decarr@redhat.com>
Sent: Thursday, May 1, 2014 11:42:52 AM
Subject: Re: [docker-source-to-images] Add parameter to STI build to invoke an optional callback url (#44)

> +	writer = bufio.NewWriter(jsonBuffer)
> +	jsonWriter := json.NewEncoder(writer)
> +	jsonWriter.Encode(d)
> +	writer.Flush()
> +
> +	var resp *http.Response
> +	var err error
> +
> +	for retries := 0; retries < 3; retries++ {
> +		resp, err = http.Post(callbackUrl, "application/json", jsonBuffer)
> +		if err != nil {
> +			errorMessage := fmt.Sprintf("Unable to invoke callback: %s", err.Error())
> +			result.Messages = append(result.Messages, errorMessage)
> +		}
> +		if resp != nil {
> +			if resp.StatusCode >= 400 {

Arguably any response except 200 is unexpected.  For instance, if you get a 301 - should you log that?

---
Reply to this email directly or view it on GitHub:
https://github.com/openshift/docker-source-to-images/pull/44/files#r12192304