Try our conversational search powered by Generative AI!

Jonas Bergqvist
Dec 8, 2016
  12294
(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
Product Listing Page - using Graph

Optimizely Graph makes it possible to query your data in an advanced way, by using GraphQL. Querying data, using facets and search phrases, is very...

Jonas Bergqvist | Jul 5, 2024

Optimizely Search and Navigation - Part 2 - Filter Tips

Introduction Continuing from Part 1 – Search Tips , today I will share the next part – filter tips. The platform versions used for this article are...

Binh Nguyen Thi | Jul 1, 2024

Integrating HubSpot CRM without the MA Connector

Have HubSpot CRM? Want to push user data into it from Optimizely? Don’t have any personalisation requirements with that data? Don’t want to pay $80...

Matt Pallatt | Jun 27, 2024

Keeping the website secure by updating external packages

Did you see the latest warning from Optimizely to update this package with a critical security warning? https://world.optimizely.com/documentation/...

Daniel Ovaska | Jun 27, 2024

Optimizely CMS image anonymization now available for Linux!

The famous image anonymization add-on for Optimizely CMS, with at least 5 downloads, is now finally available for use on Linux. Supports simultaneo...

Tomas Hensrud Gulla | Jun 25, 2024 | Syndicated blog

Remove a segment from the URL in CMS 12

Problem : I have created thousands of pages dynamically using schedule jobs with different templates (e.g. one column, two columns, etc..) and stor...

Sanjay Kumar | Jun 21, 2024