mirror of https://github.com/kubernetes/kops.git
				
				
				
			Merge pull request #1658 from justinsb/log_error_details
Improve error logging
This commit is contained in:
		
						commit
						9c07159d4d
					
				|  | @ -17,6 +17,7 @@ limitations under the License. | ||||||
| package awsup | package awsup | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"fmt" | ||||||
| 	"github.com/aws/aws-sdk-go/aws/client" | 	"github.com/aws/aws-sdk-go/aws/client" | ||||||
| 	"github.com/aws/aws-sdk-go/aws/request" | 	"github.com/aws/aws-sdk-go/aws/request" | ||||||
| 	"github.com/golang/glog" | 	"github.com/golang/glog" | ||||||
|  | @ -47,7 +48,15 @@ func (l LoggingRetryer) RetryRules(r *request.Request) time.Duration { | ||||||
| 	} | 	} | ||||||
| 	methodDescription := service + "/" + name | 	methodDescription := service + "/" + name | ||||||
| 
 | 
 | ||||||
| 	glog.Infof("Retryable error %d (%s) from %s - will retry after delay of %v", r.HTTPResponse.StatusCode, r.HTTPResponse.Status, methodDescription, duration) | 	var errorDescription string | ||||||
|  | 	if r.Error != nil { | ||||||
|  | 		// We could check aws error Code & Message, but we expect them to be in the string
 | ||||||
|  | 		errorDescription = fmt.Sprintf("%v", r.Error) | ||||||
|  | 	} else { | ||||||
|  | 		errorDescription = fmt.Sprintf("%d %s", r.HTTPResponse.StatusCode, r.HTTPResponse.Status) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	glog.Infof("Retryable error (%s) from %s - will retry after delay of %v", errorDescription, methodDescription, duration) | ||||||
| 
 | 
 | ||||||
| 	return duration | 	return duration | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue