Expand my Community achievements bar.

SOLVED

Dispatcher module throws error for DispatcherPassError unknown values

Avatar

Level 2

I am trying to set DispatcherPassError so that it only forwards HTTP status code 412 to the browser, but passes all others to Apache for handling in an ErrorDocument.

With DispatcherPassError 1 all the ErrorDocuments work fine.

 

When I set 
DispatcherPassError 400-411,413-499,500-599
according to the documentation, it complains during Apache httpd startup with
Unsupported HTTP response code 499

I know that this code is currently undefined in the RFCs, but I want to configure it so it matches everything except 412, including all possible future/unknown status codes.

How can this be done?



It's not described in the docs, so don't just point me there, because I have read them already (https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/getting-started/dispatch... ).

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@curious2improve 

Glad that it worked. 

Standards like HTTP status codes typically remain stable over time. Moreover, they aren't globally configured, allowing for custom setups tailored to individual applications using modules like 'disp_apache2.c'. The key aspect is that the implementer has the flexibility to prioritize error management according to their preferences: they might opt to handle errors internally or route them through the dispatcher.

View solution in original post

4 Replies

Avatar

Community Advisor

@curious2improve 

Your approach looks valid, but I would suggest you try with the valid error codes:

4xx Client Error:

400 - Bad Request
401 - Unauthorized
402 - Payment Required
403 - Forbidden
404 - Not Found
405 - Method Not Allowed
406 - Not Acceptable
407 - Proxy Authentication Required
408 - Request Timeout
409 - Conflict
410 - Gone
411 - Length Required
412 - Precondition Failed
413 - Payload Too Large
414 - URI Too Long
415 - Unsupported Media Type
416 - Range Not Satisfiable
417 - Expectation Failed
418 - I'm a teapot
421 - Misdirected Request
422 - Unprocessable Entity
423 - Locked
424 - Failed Dependency
425 - Too Early
426 - Upgrade Required
428 - Precondition Required
429 - Too Many Requests
431 - Request Header Fields Too Large
451 - Unavailable For Legal Reasons

5xx Server Error:

500 - Internal Server Error
501 - Not Implemented
502 - Bad Gateway
503 - Service Unavailable
504 - Gateway Timeout
505 - HTTP Version Not Supported
506 - Variant Also Negotiates
507 - Insufficient Storage
508 - Loop Detected
510 - Not Extended
511 - Network Authentication Required

 

Avatar

Level 2

Yeah, that actually works, so

DispatcherPassError 400-411,413-451,500-511
is accepted.

But I don't really understand why the dispatcher module should bother to check - since the standard can change or some custom applications may want to use some custom codes at the end of the range.
In the end, we have to make sure ourselves that matching ErrorDocument directives exist, so why would the dispatcher module care?

Avatar

Correct answer by
Community Advisor

@curious2improve 

Glad that it worked. 

Standards like HTTP status codes typically remain stable over time. Moreover, they aren't globally configured, allowing for custom setups tailored to individual applications using modules like 'disp_apache2.c'. The key aspect is that the implementer has the flexibility to prioritize error management according to their preferences: they might opt to handle errors internally or route them through the dispatcher.

Avatar

Administrator

@curious2improve Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni