abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r627241 - /incubator/abdera/java/trunk/adapters/couchdb/src/main/java/org/apache/abdera/protocol/server/adapters/couchdb/CouchDbAdapter.java
Date Wed, 13 Feb 2008 04:13:04 GMT
Author: jmsnell
Date: Tue Feb 12 20:13:03 2008
New Revision: 627241

URL: http://svn.apache.org/viewvc?rev=627241&view=rev
Log:
explain why the error blocks are empty

Modified:
    incubator/abdera/java/trunk/adapters/couchdb/src/main/java/org/apache/abdera/protocol/server/adapters/couchdb/CouchDbAdapter.java

Modified: incubator/abdera/java/trunk/adapters/couchdb/src/main/java/org/apache/abdera/protocol/server/adapters/couchdb/CouchDbAdapter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/adapters/couchdb/src/main/java/org/apache/abdera/protocol/server/adapters/couchdb/CouchDbAdapter.java?rev=627241&r1=627240&r2=627241&view=diff
==============================================================================
--- incubator/abdera/java/trunk/adapters/couchdb/src/main/java/org/apache/abdera/protocol/server/adapters/couchdb/CouchDbAdapter.java
(original)
+++ incubator/abdera/java/trunk/adapters/couchdb/src/main/java/org/apache/abdera/protocol/server/adapters/couchdb/CouchDbAdapter.java
Tue Feb 12 20:13:03 2008
@@ -91,7 +91,9 @@
       Database db = null;
       try {
         db = session.getDatabase(name);
-      } catch (Exception e) {}
+      } catch (Exception e) {
+        // error if the db is not found, ignore it, we're going to create it
+      }
       if (db == null)
         db = session.createDatabase(name);
       return db;
@@ -124,7 +126,12 @@
       String entry = target.getParameter("entry");
       Session session = new Session(host,port);
       Database db = session.getDatabase(feed);
-      Document doc = db.getDocument(entry);
+      Document doc = null;
+      try {
+        doc = db.getDocument(entry);
+      } catch (Exception e) {
+        // error if the doc isn't found, we deal with the null result below
+      }
       if (doc != null) {
         db.deleteDocument(doc);
         return ProviderHelper.nocontent();
@@ -166,7 +173,9 @@
         Document doc = null;
         try {
           doc = db.getDocument(key);
-        } catch (Exception e) {}
+        } catch (Exception e) {
+          // error if the doc isn't found, we deal with the null result below
+        }
         if (doc != null) { 
           return ProviderHelper.conflict(
             request, 
@@ -215,7 +224,9 @@
       Document doc = null;
       try {
         doc = db.getDocument(entry);
-      } catch (Exception e) {}
+      } catch (Exception e) {
+        // error if the doc isn't found, we deal with the null result below
+      }
       if (doc != null)
         return new JsonObjectResponseContext(
           request.getAbdera(),
@@ -243,7 +254,9 @@
         Document doc = null;
         try {
           doc = db.getDocument(key);
-        } catch (Exception e) {}
+        } catch (Exception e) {
+          // error if the doc isn't found, we deal with the null result below
+        }
         if (doc == null) { 
           return ProviderHelper.notfound(request);
         } else {



Mime
View raw message