From 42f37d8fee6d19d8a15bc51121347e9727cfa053 Mon Sep 17 00:00:00 2001 From: rr- Date: Wed, 5 Aug 2015 17:19:10 +0200 Subject: [PATCH] Further improved text of some error messages --- src/Search/Parsers/SnapshotSearchParser.php | 8 ++++---- src/Search/Parsers/TagSearchParser.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Search/Parsers/SnapshotSearchParser.php b/src/Search/Parsers/SnapshotSearchParser.php index 9d63a0fb..18a78374 100644 --- a/src/Search/Parsers/SnapshotSearchParser.php +++ b/src/Search/Parsers/SnapshotSearchParser.php @@ -18,10 +18,10 @@ class SnapshotSearchParser extends AbstractSearchParser protected function decorateFilterFromToken(IFilter $filter, SearchToken $token) { if (substr_count($token->getValue(), ',') !== 1) - throw new NotSupportedException(); + throw new NotSupportedException('Expected token in form of "type,id"'); if ($token->isNegated()) - throw new NotSupportedException(); + throw new NotSupportedException('Negative searches are not supported in this context'); list ($type, $primaryKey) = explode(',', $token->getValue()); @@ -38,11 +38,11 @@ class SnapshotSearchParser extends AbstractSearchParser protected function decorateFilterFromNamedToken(IFilter $filter, NamedSearchToken $namedToken) { - throw new NotSupportedException(); + throw new NotSupportedException('Named tokens are not supported in this context'); } protected function getOrderColumnMap() { - throw new NotSupportedException(); + throw new NotSupportedException('Search order is not supported in this context'); } } diff --git a/src/Search/Parsers/TagSearchParser.php b/src/Search/Parsers/TagSearchParser.php index f33300f3..d10f1a9c 100644 --- a/src/Search/Parsers/TagSearchParser.php +++ b/src/Search/Parsers/TagSearchParser.php @@ -35,7 +35,7 @@ class TagSearchParser extends AbstractSearchParser self::ALLOW_COMPOSITE); } - throw new NotSupportedException(); + throw new NotSupportedException('Unknown token: ' . $namedToken->getKey()); } protected function getOrderColumnMap()