Repository: cxf Updated Branches: refs/heads/master 5182ed51f -> c36a2388f
CXF-5868 Revering status code mapping as a fault always must have status code 500 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c36a2388 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c36a2388 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c36a2388 Branch: refs/heads/master Commit: c36a2388f6d170e66f0dc98b21d184b2151f4b75 Parents: 5182ed5 Author: Christian Schneider <[email protected]> Authored: Thu Jul 10 15:36:36 2014 +0200 Committer: Christian Schneider <[email protected]> Committed: Thu Jul 10 15:36:36 2014 +0200 ---------------------------------------------------------------------- .../java/org/apache/cxf/interceptor/Fault.java | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/c36a2388/core/src/main/java/org/apache/cxf/interceptor/Fault.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/interceptor/Fault.java b/core/src/main/java/org/apache/cxf/interceptor/Fault.java index 3e44adf..b5bc123 100644 --- a/core/src/main/java/org/apache/cxf/interceptor/Fault.java +++ b/core/src/main/java/org/apache/cxf/interceptor/Fault.java @@ -23,16 +23,13 @@ import java.net.HttpURLConnection; import java.util.ResourceBundle; import java.util.logging.Logger; -import javax.security.auth.login.LoginException; import javax.xml.namespace.QName; -import org.w3c.dom.Element; - import org.apache.cxf.common.i18n.Message; import org.apache.cxf.common.i18n.UncheckedException; import org.apache.cxf.helpers.DOMUtils; -import org.apache.cxf.interceptor.security.AccessDeniedException; -import org.apache.cxf.interceptor.security.AuthenticationException; + +import org.w3c.dom.Element; /** * A Fault that occurs during invocation processing. @@ -58,7 +55,6 @@ public class Fault extends UncheckedException { super(message, throwable); this.messageString = message.toString(); code = FAULT_CODE_SERVER; - determineStatusCode(throwable); } public Fault(Message message) { @@ -94,14 +90,12 @@ public class Fault extends UncheckedException { messageString = t == null ? null : t.getMessage(); } code = FAULT_CODE_SERVER; - determineStatusCode(t); } public Fault(Message message, Throwable throwable, QName fc) { super(message, throwable); this.messageString = message.toString(); code = fc; - determineStatusCode(throwable); } public Fault(Message message, QName fc) { @@ -118,16 +112,6 @@ public class Fault extends UncheckedException { messageString = t == null ? null : t.getMessage(); } code = fc; - determineStatusCode(t); - } - - private void determineStatusCode(Throwable throwable) { - if (throwable instanceof AuthenticationException || throwable instanceof LoginException) { - statusCode = HttpURLConnection.HTTP_UNAUTHORIZED; - } - if (throwable instanceof AccessDeniedException) { - statusCode = HttpURLConnection.HTTP_FORBIDDEN; - } } public String getMessage() {
