data publish seq start from 0; use exception to indicate error in getting the
seq for a prefix
diff --git a/model/sync-app-data-publish.cc b/model/sync-app-data-publish.cc
index 17d52ee..bc1281b 100644
--- a/model/sync-app-data-publish.cc
+++ b/model/sync-app-data-publish.cc
@@ -21,6 +21,9 @@
  */
 
 #include "sync-app-data-publish.h"
+#include <boost/throw_exception.hpp>
+typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str;
+typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int;
 
 using namespace std;
 using namespace boost;
@@ -28,6 +31,7 @@
 namespace Sync
 {
 
+
 string
 AppDataPublish::getRecentData (const string &prefix, uint32_t session)
 {
@@ -48,20 +52,22 @@
       if (s.session == session)
         return s.seq;
     }
-
-  return 0;
+	else
+    BOOST_THROW_EXCEPTION(GetSeqException() << errmsg_info_str("No corresponding seq"));
 }
 
 bool
 AppDataPublish::publishData (const string &name, uint32_t session, const string &dataBuffer, int freshness)
 {
-  uint32_t seq = getHighestSeq(name, session);
-  if (seq == 0)
+  uint32_t seq = 0;
+	try
+		{
+			seq =  getHighestSeq(name, session);
+		}
+	catch (GetSeqException &e){
     m_sequenceLog.erase(name);
+	}
 
-  seq++;
-  if (seq == 0)
-    seq = 1;
   Seq s;
   s.session = session;
   s.seq = seq;
diff --git a/model/sync-app-data-publish.h b/model/sync-app-data-publish.h
index d072189..204a076 100644
--- a/model/sync-app-data-publish.h
+++ b/model/sync-app-data-publish.h
@@ -36,6 +36,8 @@
   uint32_t seq;
 };
 
+struct GetSeqException : virtual boost::exception, virtual std::exception { };
+
 /**
  * \ingroup sync
  * @brief publishes application data using incrementing sequence number (for
diff --git a/test/test_app_socket.cc b/test/test_app_socket.cc
index f6edc61..f5b7384 100644
--- a/test/test_app_socket.cc
+++ b/test/test_app_socket.cc
@@ -40,6 +40,7 @@
   map<string, string> data;
   void set(string str1, string str2) {
     data.insert(make_pair(str1, str2));
+		cout << "Got: "<< str1 <<" => "<< str2 <<endl;
   }
 
   string toString(){