From bc949f259f1bce915ab6d932dfc7c554e5cae895 Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Tue, 31 Mar 2020 10:28:28 -0500 Subject: [PATCH] Improve error messages related to Selectors This change modifies the error messages related to Selectors by delegating formatting to the Selector's String method. Change-Id: I88acb70751509e588139ea26a8388661b3f63511 Relates-To: #145 --- pkg/document/errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/document/errors.go b/pkg/document/errors.go index 84ca11334..f383900f0 100644 --- a/pkg/document/errors.go +++ b/pkg/document/errors.go @@ -28,7 +28,7 @@ type ErrMultipleDocsFound struct { } func (e ErrDocNotFound) Error() string { - return fmt.Sprintf("Document filtered by selector %q found no documents", e.Selector) + return fmt.Sprintf("Document filtered by selector %v found no documents", e.Selector) } func (e ErrDocumentDataKeyNotFound) Error() string { @@ -40,5 +40,5 @@ func (e ErrDocumentMalformed) Error() string { } func (e ErrMultipleDocsFound) Error() string { - return fmt.Sprintf("Document filtered by selector %q found more than one document", e.Selector) + return fmt.Sprintf("Document filtered by selector %v found more than one document", e.Selector) }