From ffe95096b3b8e473619e707ce6cf515474d62b28 Mon Sep 17 00:00:00 2001
From: Eric Cano <Eric.Cano@cern.ch>
Date: Fri, 27 Nov 2015 18:48:00 +0100
Subject: [PATCH] Added type display when failing to dump.

---
 objectstore/GenericObject.cpp | 4 +++-
 objectstore/dumpObject.cpp    | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/objectstore/GenericObject.cpp b/objectstore/GenericObject.cpp
index 2016ecb5e9..72632c22d3 100644
--- a/objectstore/GenericObject.cpp
+++ b/objectstore/GenericObject.cpp
@@ -126,7 +126,9 @@ std::string GenericObject::dump(ScopedSharedLock& lock) {
     case serializers::AgentRegister_t:
       return dumpWithType<AgentRegister>(this, lock);
     default:
-      throw std::runtime_error("Unsupported type");
+      std::stringstream err;
+      err << "Unsupported type: " << m_header.type();
+      throw std::runtime_error(err.str());
   }
 }
 
diff --git a/objectstore/dumpObject.cpp b/objectstore/dumpObject.cpp
index 4d51625580..d12ff6a6dc 100644
--- a/objectstore/dumpObject.cpp
+++ b/objectstore/dumpObject.cpp
@@ -42,13 +42,13 @@ int main(int argc, char ** argv) {
       dynamic_cast<cta::objectstore::BackendVFS &>(*be).noDeleteOnExit();
     } catch (std::bad_cast &){}
     std::cout << "Object store path: " << be->getParams()->toURL() 
-        << " object name=" << argv[2];
+        << " object name=" << argv[2] << std::endl;
     cta::objectstore::GenericObject ge(argv[2], *be);
     cta::objectstore::ScopedSharedLock gel(ge);
     ge.fetch();
     std::cout << ge.dump(gel) << std::endl;
   } catch (std::exception & e) {
-    std::cerr << "Failed to initialise the root entry in a new VFS backend store"
+    std::cerr << "Failed to dump object: "
         << std::endl << e.what() << std::endl;
   }
 }
\ No newline at end of file
-- 
GitLab