You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/11/29 10:46:22 UTC
[camel] 03/04: CAMEL-17141: camel-health - Include error details for HTTP status code.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 876f8716974b985f9132351842b1ebffe062ab79
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Nov 29 11:42:44 2021 +0100
CAMEL-17141: camel-health - Include error details for HTTP status code.
---
.../http/base/HttpOperationFailedException.java | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpOperationFailedException.java b/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpOperationFailedException.java
index 2122860..eb4f840 100644
--- a/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpOperationFailedException.java
+++ b/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpOperationFailedException.java
@@ -19,10 +19,11 @@ package org.apache.camel.http.base;
import java.util.Map;
import org.apache.camel.CamelException;
+import org.apache.camel.spi.HttpResponseAware;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.URISupport;
-public class HttpOperationFailedException extends CamelException {
+public class HttpOperationFailedException extends CamelException implements HttpResponseAware {
private static final long serialVersionUID = -8721487434390572634L;
private final String uri;
private final String redirectLocation;
@@ -76,4 +77,23 @@ public class HttpOperationFailedException extends CamelException {
return responseBody;
}
+ @Override
+ public int getHttpResponseCode() {
+ return statusCode;
+ }
+
+ @Override
+ public void setHttpResponseCode(int code) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getHttpResponseStatus() {
+ return statusText;
+ }
+
+ @Override
+ public void setHttpResponseStatus(String status) {
+ throw new UnsupportedOperationException();
+ }
}