You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2015/11/18 13:56:46 UTC
cxf git commit: Adding OAuthServiceExceptionMapper,
can be useful when the error needs to be mapped to a form
Repository: cxf
Updated Branches:
refs/heads/master 44425584c -> 9b500dde6
Adding OAuthServiceExceptionMapper, can be useful when the error needs to be mapped to a form
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9b500dde
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9b500dde
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9b500dde
Branch: refs/heads/master
Commit: 9b500dde6fe67a991addf4985802431f5c13a3f8
Parents: 4442558
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Wed Nov 18 12:56:28 2015 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Wed Nov 18 12:56:28 2015 +0000
----------------------------------------------------------------------
.../provider/OAuthServiceExceptionMapper.java | 31 ++++++++++++++++++++
1 file changed, 31 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/9b500dde/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthServiceExceptionMapper.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthServiceExceptionMapper.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthServiceExceptionMapper.java
new file mode 100644
index 0000000..7545570
--- /dev/null
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthServiceExceptionMapper.java
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.rs.security.oauth2.provider;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+
+public class OAuthServiceExceptionMapper implements ExceptionMapper<OAuthServiceException> {
+
+ @Override
+ public Response toResponse(OAuthServiceException exception) {
+ return Response.ok().entity(exception.getError()).build();
+ }
+
+}