Better error message when trying to monitor a non minio s3 provider (#1854)
This commit is contained in:
committed by
Harshavardhana
parent
d9b3f276b8
commit
b737b2e7fc
+6
-1
@@ -397,7 +397,12 @@ func (c *s3Client) Watch(params watchParams) (*watchObject, *probe.Error) {
|
||||
go func() {
|
||||
for notificationInfo := range eventsCh {
|
||||
if notificationInfo.Err != nil {
|
||||
errorChan <- probe.NewError(notificationInfo.Err)
|
||||
if nErr, ok := notificationInfo.Err.(minio.ErrorResponse); ok && nErr.Code == "APINotSupported" {
|
||||
errorChan <- probe.NewError(errors.New("The specified S3 target is not supported. " +
|
||||
"Only Minio based storages provide monitoring feature."))
|
||||
} else {
|
||||
errorChan <- probe.NewError(notificationInfo.Err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user