1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #37944 from IRCody/awslogs_error_context

Return more context on awslogs create failure
This commit is contained in:
Sebastiaan van Stijn 2018-10-24 21:00:15 +02:00 committed by GitHub
commit b48bf39a79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -380,13 +380,17 @@ func (l *logStream) create() error {
if l.logCreateGroup {
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == resourceNotFoundCode {
if err := l.createLogGroup(); err != nil {
return err
return errors.Wrap(err, "failed to create Cloudwatch log group")
}
return l.createLogStream()
err := l.createLogStream()
if err != nil {
return errors.Wrap(err, "failed to create Cloudwatch log stream")
}
return nil
}
}
if err != nil {
return err
return errors.Wrap(err, "failed to create Cloudwatch log stream")
}
}