You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/01/21 13:52:18 UTC

[camel] 01/02: CAMEL-16068 - Camel-AWS2-S3: Fix condition for throwing exception in case bucket does not exist

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e6b35ba74b96a2118757d453e589a3b8ac451a7e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jan 21 14:39:59 2021 +0100

    CAMEL-16068 - Camel-AWS2-S3: Fix condition for throwing exception in case bucket does not exist
---
 .../main/java/org/apache/camel/component/aws2/s3/AWS2S3Endpoint.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Endpoint.java b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Endpoint.java
index 1b3f04f..78f1523 100644
--- a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Endpoint.java
+++ b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Endpoint.java
@@ -116,7 +116,7 @@ public class AWS2S3Endpoint extends ScheduledPollEndpoint {
             return;
         } catch (AwsServiceException ase) {
             /* 404 means the bucket doesn't exist */
-            if (ase.awsErrorDetails().errorCode().equalsIgnoreCase("404")) {
+            if (!(ase.awsErrorDetails().sdkHttpResponse().statusCode() == 404)) {
                 throw ase;
             }
         }