Reputation: 2261
I am trying to implement proper error handling in my code. There is a request component, which hits a specific api. I have to handle the scenario, where "server couldn't send a response" exception occurs. Mule does not identify it as a HTTP:NOT FOUND error instead it identifies it as MULE:UNKNOWN. How should I handle this case ? I want mule to identify it as a HTTP error.
EDIT:
How do I handle the MULE:UNKNOWN error type. I dont want to handle it under ANY and the compiler doesn't accept the type MULE : UNKNOWN. ?
org.mule.runtime.deployment.model.api.DeploymentException: Failed to deploy artifact [] Caused by: org.mule.runtime.api.exception.MuleRuntimeException: org.mule.runtime.deployment.model.api.DeploymentInitException: MuleRuntimeException: Could not find ErrorType for the given identifier: 'MULE:UNKNOWN' Caused by: org.mule.runtime.deployment.model.api.DeploymentInitException: MuleRuntimeException: Could not find ErrorType for the given identifier: 'MULE:UNKNOWN' Caused by: org.mule.runtime.core.api.config.ConfigurationException: Could not find ErrorType for the given identifier: 'MULE:UNKNOWN' Caused by: org.mule.runtime.api.lifecycle.InitialisationException: Could not find ErrorType for the given identifier: 'MULE:UNKNOWN' Caused by: org.mule.runtime.api.lifecycle.LifecycleException: Could not find ErrorType for the given identifier: 'MULE:UNKNOWN' Caused by: org.mule.runtime.api.exception.MuleRuntimeException: Could not find ErrorType for the given identifier: 'MULE:UNKNOWN'
Upvotes: 3
Views: 2156
Reputation: 25699
HTTP:NOT FOUND means that the server returned an HTTP 404 (ie not found) response. If the server aborted the response for any reason it is not expected that the HTTP Requester to return a NOT FOUND. Having said that, the MULE:UNKNOWN error indicates an error that the component can not handle. You could try to update the version of the HTTP Connector to the last one to see if it has been improved to handle better that particular situation. Check the release notes to see if a newest one has been released.
Upvotes: 2