2

I have a route that calls the HTTP component in Camel 3.3. This is working fine and I am trying to catch the HttpOperationFailedException which is being thrown.

I have declared the following error handler in my camel route:

    <onException>
            <exception>org.apache.camel.http.common.HttpOperationFailedException</exception>
    </onException>

The org.apache.camel.http.common.HttpOperationFailedExceptionis showing up as being depcrecatted and when I look at the documentation for Camel 3.3 I cant even find the HttpOperationFailedException.

Accoding to the JavaDoc the last time HttpOperationFailedException was listed was in the 2.25.1 release. According to the 3.3.0 javadoc the HttpOperationFailedException has been removed yet in my project it still throws it.

I double check my effective pom and this my dependency:

 <dependency>
        <groupId>org.apache.camel.springboot</groupId>
        <artifactId>camel-http-common-starter</artifactId>
        <version>3.3.0</version>
 </dependency>

I am pushing forward and using the exception but can someone please share some light on what is going on? Is this a mistake in the docs? If the HttpOperationFailedException was deprecated and/or removed what will replace it?

Namphibian
  • 12,046
  • 7
  • 46
  • 76

1 Answers1

3

See the javadoc of the deprecated class what to use: https://github.com/apache/camel/blob/master/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpOperationFailedException.java#L22

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • Thanks Claus. Is there anyway I can help contribute with the documentation? I know Camel is changing fast and I got a bunch of guys learning it at the moment and they are sometimes frustrated as the examples dont always match up with the real thing. – Namphibian Jun 17 '20 at 23:08
  • We have marked in the javadoc for deprecated classes what else to use. Sadly the JDK @Deprecatation annotation dont allow to provide any information. But the javadoc is standard so it would be no stranger for your team to look at that. Yeah for helping the project then it loves contributions, so see https://camel.apache.org/manual/latest/contributing.html - docs, examples etc is welcome to help with. The examples are in their own repos now, link you can find on the website. Looking forward to you and your teams help. – Claus Ibsen Jun 18 '20 at 18:29
  • The link in this answer is dead. I think the class has been moved to a different component/package [camel/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpOperationFailedException.java](https://github.com/apache/camel/blob/main/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpOperationFailedException.java) – Snekse Nov 14 '22 at 18:11