Try our conversational search powered by Generative AI!

Jonas Bergqvist
Dec 8, 2016
  12102
(7 votes)

Exceptions in Find

Episerver Find can be used in many places on a site, like menus, navigations, listings, and searches. One thing that usually are forgotten when using Find is that it’s a service in the “cloud”, where you should handle possible exceptions.

EPiServer.Find.ServiceException

The “ServiceException” is the most important exception that should be handled in every place where Find is used. This exception will be thrown if the service is down, or if there is any other communication problem.

This exception inherits from ApplicationException.

EPiServer.Find.ClientException

The “ClientException” can be thrown when the query contains errors that is found at runtime. There is also several specific exceptions that inherit from “ClientException”.

This exception inherits from ApplicationException.

EPiServer.Find.SelfReferencingLoopException

The “SelfReferencingLoopException” will be thrown if a circular reference is found at runtime. There can for example exist a “Parent” property on a class, where the class of the parent property has a reference to the current class.

This exception inherits from ClientException.

EPiServer.Find.ProjectionException

The “ProjectionException” will be thrown if the projection (Select) is used in the wrong way in the query.

This exception inherits from ClientException.

EPiServer.Find.Api.InvalidIndexIdException

The “InvalidIndexIdException” will be thrown if the id of the index is null, or over 100 characters.

This exception inherits from ClientException.

EPiServer.Find.Api.InvalidDocumentIdException

The “InvalidDocumentIdException” will be thrown if the id of the document is null, or over 100 characters.

This exception inherits from ClientException.

EPiServer.Find.Api.InvalidSearchRequestException

The “InvalidSearchRequestException” will be thrown if the terms facet has been set to a value less than 0, or higher than 1000.

This exception inherits from ClientException.

Conclusion

Handle “EPiServer.Find.ServiceException” and “EPiServer.Find.ClientException” on all places where a query is created and executed against Find.

Dec 08, 2016

Comments

Please login to comment.
Latest blogs
Azure AI Language – Extractive Summarisation in Optimizely CMS

In this article, I demonstrate how extractive summarisation, provided by the Azure AI Language platform, can be leveraged to produce a set of summa...

Anil Patel | Apr 26, 2024 | Syndicated blog

Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog