Exception Handling in Endeca
Hi All,
I am Going to Share
Some Basics note about Exception Handling in Endeca . We will be having Many
Scenarios that has to be handled, so that the Users will not lead to seeing the
Error or the Exceptions. I am sharing my Experience it varies from the
Implementation Perspective from developers to developers .
When we are implementing the Assembler Approach there are
only two types of Exceptions will be land in to and we have to handle everything
within it.
Exception
|
Description
|
AssemblerException
|
This Exception states that the exception occurred during the process
or creating the Assembler Request. Eg ene Query,Host Exception
|
CartridgeHandlerException
|
This Exception Occurs while calling the single Cartridge handler,
usually exceptions like NPE,Range Exceptions .
|
Well, we have Seen These Two Exceptions and next step is to
how to bring these Exceptions in to our applications. When the endeca contentItems
are rendered from the JSP then it is with the Developer, who renders it and no
need to worry about this status. Where else we are going with the Rest or the
JAX-RS Approach which requires these Scenarios to be handled before Sending the
Status to the Service.
When you see the Architecture, there is no way we can handled
the Exception Thrown. So what we have to do? Customize the Invoke Assembler or
Assembler Tools only for the Exceptions? Not required.
So here is what you have to do, When the Assembler Exception
Happens or the Cartridge Handler Exceptions Happens you are able to see the
@error Param on the Content Item, when you go in to this param , you could able
to see the type of exception. You can write a wrapper on top of the Calling type
method for example in the Actor Chains, if it is going to be the Rest MVC
architecture and Nucleus Resource Class in case of the JAX-RS Implementation,
take the ContentItem that InvokeAssmbler Returns send it the Method and Parse it,
weather it is network, Invalid key, NPE, Range, MDEX Down, Class Cast Exception
and handle it appropriately based on the Type of Exception Status and Error Codes. . If the Content Item is null then blindly throw it as 500 Status .
I have handled in the above way Instead of throwing the
Generic Exceptions, and it is working as Excepted. Hope you have understood the
Easiest Way of handling the types of Exceptions in Endeca.
If you have any other Reference of handling it can Suggest Below.
Happy Learning !!!!!