SaaS CMS has officially launched! Learn more now.

Jonas Bergqvist
Dec 8, 2016
  12323
(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
A day in the life of an Optimizely Developer - London Meetup 2024

Hello and welcome to another instalment of A Day In The Life Of An Optimizely Developer. Last night (11th July 2024) I was excited to have attended...

Graham Carr | Jul 16, 2024

Creating Custom Actors for Optimizely Forms

Optimizely Forms is a powerful tool for creating web forms for various purposes such as registrations, job applications, surveys, etc. By default,...

Nahid | Jul 16, 2024

Optimizely SaaS CMS Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024

How to have a link plugin with extra link id attribute in TinyMce

Introduce Optimizely CMS Editing is using TinyMce for editing rich-text content. We need to use this control a lot in CMS site for kind of WYSWYG...

Binh Nguyen Thi | Jul 13, 2024

Create your first demo site with Optimizely SaaS/Visual Builder

Hello everyone, We are very excited about the launch of our SaaS CMS and the new Visual Builder that comes with it. Since it is the first time you'...

Patrick Lam | Jul 11, 2024

Integrate a CMP workflow step with CMS

As you might know Optimizely has an integration where you can create and edit pages in the CMS directly from the CMP. One of the benefits of this i...

Marcus Hoffmann | Jul 10, 2024