abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r655553 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java
Date Mon, 12 May 2008 16:39:01 GMT
Author: jmsnell
Date: Mon May 12 09:39:00 2008
New Revision: 655553

URL: http://svn.apache.org/viewvc?rev=655553&view=rev
Log:
Add a createErrorResponse method to AbstractProvider so custom implementation can easily customize
the kind of error response returned 

see https://issues.apache.org/jira/browse/ABDERA-132

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java?rev=655553&r1=655552&r2=655553&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractProvider.java
Mon May 12 09:39:00 2008
@@ -163,13 +163,20 @@
           log.error(e);
         }
         transactionCompensate(transaction, request, e);
-        response = ProviderHelper.servererror(request, e);
+        response = createErrorResponse(request,e);
         return response;
       } finally {
         transactionEnd(transaction,request,response);
       }
   }
 
+  /**
+   * Subclass to customize the kind of error response to return
+   */
+  protected ResponseContext createErrorResponse(RequestContext request, Throwable e) {
+    return ProviderHelper.servererror(request, e);
+  }
+  
   protected void transactionCompensate(
     Transactional transactional,
     RequestContext request,



Mime
View raw message