Commit f003f75b authored by Eric Cano's avatar Eric Cano
Browse files

Added type display when failing to dump.

parent d1086860
......@@ -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());
}
}
......
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment