From b737b2e7fc0057d4de731bca81864317f93f8155 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Thu, 13 Oct 2016 17:16:46 +0100 Subject: [PATCH] Better error message when trying to monitor a non minio s3 provider (#1854) --- cmd/client-s3.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/client-s3.go b/cmd/client-s3.go index 7bd6179d..cba452b9 100644 --- a/cmd/client-s3.go +++ b/cmd/client-s3.go @@ -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 }