Skip to content

Commit

Permalink
Allow listen bucket notification proactively return errors
Browse files Browse the repository at this point in the history
ListenBucketNotification should error out on all
conditions for invalid arguments. Network error
should be retried.
  • Loading branch information
harshavardhana authored and minio-trusted committed Nov 1, 2017
1 parent 8f36976 commit 10d3faf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api-notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (c Client) ListenBucketNotification(bucketName, prefix, suffix string, even
// Check ARN partition to verify if listening bucket is supported
if s3utils.IsAmazonEndpoint(c.endpointURL) || s3utils.IsGoogleEndpoint(c.endpointURL) {
notificationInfoCh <- NotificationInfo{
Err: ErrAPINotSupported("Listening bucket notification is specific only to `minio` partitions"),
Err: ErrAPINotSupported("Listening for bucket notification is specific only to `minio` server endpoints"),
}
return
}
Expand All @@ -177,7 +177,10 @@ func (c Client) ListenBucketNotification(bucketName, prefix, suffix string, even
contentSHA256Hex: emptySHA256Hex,
})
if err != nil {
continue
notificationInfoCh <- NotificationInfo{
Err: err,
}
return
}

// Validate http response, upon error return quickly.
Expand Down

0 comments on commit 10d3faf

Please sign in to comment.