Issue in Custom Error Handler | Community
Skip to main content
Level 3
June 22, 2023
Solved

Issue in Custom Error Handler

  • June 22, 2023
  • 2 replies
  • 1455 views

Hi Team,

We are implementing a custom error handler page, so we have added in dispatcher file ErrorDocument 404 to custom handler page.

 

when we are calling to any page, which are not there in Author, from dispatcher then its giving the custom error page but while calling "/crx/explorer/index.jsp.css" , its not giving custom error handler page.

Can someone please help here

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Tanika02

Hello @skumari - 

 

You can go to the dispatcher.any file => Locate the /filter section

Later you can make the changes like below : 

/filter { /filter_rules { # Rule to handle /crx/explorer/index.jsp.css /0001 { /type "allow" /glob "*index.jsp.css" /redirect "https://example.com/custom-error-handler" } # Additional rules... # Default rule for handling other requests /default { /type "deny" /redirect "https://example.com/custom-error-handler" } } }

 

Regards,

Tanika 🙂

2 replies

bilal_ahmad
Level 5
June 22, 2023

@skumari @ What's the use case here? What are you achieving here by hitting "/crx/explorer/index.jsp.css" ?

 

Can you elaborate as to why/how. Thanks,

Bilal

skumariAuthor
Level 3
June 22, 2023

Hi @bilal_ahmad 

I am getting below response while hitting the from Pub/Dis, which shouldn't be the case. I should have get the custom error page with 404 response code.

 

Tanika02
Level 7
June 22, 2023

Hello @skumari - 

 

  • When configuring a custom error handler page in dispatcher.any, the ErrorDocument directive is typically used to specify the custom page for handling specific HTTP error codes, such as 404 (Not Found) errors. However, the Dispatcher may not handle requests for certain resources, such as /crx/explorer/index.jsp.css, as it bypasses the configured error handling.
  • To address this issue, you can modify your dispatcher configuration to handle such requests and redirect them to your custom error handler page. Here's how you can do it : 

Go to dispatcher.any file => locate the "rules" section => Add a new rule to handle the specific request for /crx/explorer/index.jsp.css

 
/crx/explorer/index.jsp.css
{
/redirect "http://your-custom-error-page-url"
}

 Restart dispatcher and it should be able to solve the problem.

 

Regards,

Tanika 😊

 

skumariAuthor
Level 3
June 22, 2023

Hi @tanika02 

Do i need to put the above rule in this section(/rules from screenshot)?

 

Tanika02
Tanika02Accepted solution
Level 7
June 22, 2023

Hello @skumari - 

 

You can go to the dispatcher.any file => Locate the /filter section

Later you can make the changes like below : 

/filter { /filter_rules { # Rule to handle /crx/explorer/index.jsp.css /0001 { /type "allow" /glob "*index.jsp.css" /redirect "https://example.com/custom-error-handler" } # Additional rules... # Default rule for handling other requests /default { /type "deny" /redirect "https://example.com/custom-error-handler" } } }

 

Regards,

Tanika 🙂