diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-08-18 11:15:50 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-08-18 11:15:50 +0200 |
commit | c30bbdb0fa50cedc56eec71feeadc969ba5a3edf (patch) | |
tree | 6935b4d042618900ee0f7fd291c14ed55ae06cf8 /container-search/src/main/java/com/yahoo/search/pagetemplates/engine/Organizer.java | |
parent | 529694a88d48270298171fdcb87d1439f183202b (diff) |
Skip logging only for IllegalInputException
- Add IllegalInputException to signal cases where we know the exception
is caused by illegal input received from the requestor.
- Only skip logging for IllegalInputException instead of the superclass
IllegalArgumentException as that is also used to signal illegal
arguments to methods due to bugs which are otherwise hard to debug.
- Throw IllegalInputException rather than IllegalArgumentException
where appropriate.
- Deprecated QueryException as it was only used to be able to separate
between query string and query parameter exceptions, and not doing
that consistently, and is in a package we don't want more use of.
- Clean up some cases where the wrong exception was thrown.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/pagetemplates/engine/Organizer.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/pagetemplates/engine/Organizer.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/pagetemplates/engine/Organizer.java b/container-search/src/main/java/com/yahoo/search/pagetemplates/engine/Organizer.java index 3e6e82a5584..051103cba06 100644 --- a/container-search/src/main/java/com/yahoo/search/pagetemplates/engine/Organizer.java +++ b/container-search/src/main/java/com/yahoo/search/pagetemplates/engine/Organizer.java @@ -9,9 +9,7 @@ import com.yahoo.search.query.Sorting; import com.yahoo.search.result.*; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.Map; /** * Reorganizes and prunes a result as prescribed by a resolved template. @@ -29,13 +27,13 @@ public class Organizer { * @param result the result to organize */ public void organize(Choice templateChoice, Resolution resolution, Result result) { - PageTemplate template=(PageTemplate)templateChoice.get(resolution.getResolution(templateChoice)).get(0); - SectionHitGroup sectionGroup =toGroup(template.getSection(),resolution,result); - ErrorHit errors=result.hits().getErrorHit(); + PageTemplate template = (PageTemplate)templateChoice.get(resolution.getResolution(templateChoice)).get(0); + SectionHitGroup sectionGroup = toGroup(template.getSection(), resolution, result); + ErrorHit errors = result.hits().getErrorHit(); // transfer state from existing hit sectionGroup.setQuery(result.hits().getQuery()); - if (errors!=null && errors instanceof DefaultErrorHit) + if (errors instanceof DefaultErrorHit) sectionGroup.add((DefaultErrorHit)errors); result.hits().forEachField((name, value) -> sectionGroup.setField(name, value)); result.setHits(sectionGroup); |