cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1404264 - in /cxf/branches/2.6.x-fixes: ./ rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
Date Wed, 31 Oct 2012 17:35:44 GMT
Author: sergeyb
Date: Wed Oct 31 17:35:43 2012
New Revision: 1404264

URL: http://svn.apache.org/viewvc?rev=1404264&view=rev
Log:
Merged revisions 1404262 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1404262 | sergeyb | 2012-10-31 17:30:57 +0000 (Wed, 31 Oct 2012) | 1 line
  
  Reporting 400 from AtomPojoProvider in case of read failures
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1404262

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java?rev=1404264&r1=1404263&r2=1404264&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
Wed Oct 31 17:35:43 2012
@@ -544,16 +544,18 @@ public class AtomPojoProvider extends Ab
         }
         
     }
-    
-    private void reportError(String message, Exception ex) {
+    private void reportError(String message, Exception ex, int status) {
         LOG.warning(message);
-        Response response = Response.status(500).type("text/plain").entity(message).build();
+        Response response = Response.status(status).type("text/plain").entity(message).build();
         if (ex == null) {
             throw new WebApplicationException(response);
         } else {
             throw new WebApplicationException(ex, response);
         }
     }
+    private void reportError(String message, Exception ex) {
+        reportError(message, ex, 500);
+    }
     
     private boolean isFeedRequested(MediaType mt) {
         if ("entry".equals(mt.getParameters().get("type"))) {
@@ -631,7 +633,7 @@ public class AtomPojoProvider extends Ab
             m.invoke(instance, new Object[]{objects});
             
         } catch (Exception ex) {
-            reportError("Object of type " + cls.getName() + " can not be deserialized from
Feed", ex);
+            reportError("Object of type " + cls.getName() + " can not be deserialized from
Feed", ex, 400);
         }
         return instance;
     }
@@ -650,7 +652,7 @@ public class AtomPojoProvider extends Ab
                 jaxbProvider.getJAXBContext(cls, cls).createUnmarshaller();
             return cls.cast(um.unmarshal(new StringReader(entry.getContent())));
         } catch (Exception ex) {
-            reportError("Object of type " + cls.getName() + " can not be deserialized from
Entry", ex);
+            reportError("Object of type " + cls.getName() + " can not be deserialized from
Entry", ex, 400);
         }
         return null;
     }



Mime
View raw message