We want to create a custom fault rule for the below 404 Error "ApplicationNotFound" error when API endpoint is not correct.
{ "fault": { "faultstring":"Unable to identify proxy for host: <hostalias>:443 and url: \/somepath", "detail":{ "errorcode":"messaging.adaptors.http.flow.ApplicationNotFound"} } }
We are able to use the Fault rules and create custom error message for 401 Errors with "InvalidAPIKey" or "FailedToResolveAPIKey".
However, we notice that when we get the above 404 Error , we are unable to capture in the trace or generate any custom error message.
Is it possible to create a custom error message when we get the above 404 Error ?
Solved! Go to Solution.
When an API request hits the Message Processor (MP) component in Apigee Edge, it checks whether it is able to find the specific Proxy for which the request is made.
If it can't find then it responds with 404 response code with the following error message:
"Unable to identify proxy for host: <hostalias>:<port#> and url: \/somepath"
This happens much before the MP can process the request or execute any policies in the request.
Hence, these requests don't show up in the trace.
Thus, you won't be able to generate a custom error message using Fault Rule for the above 404 Error.