summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-05-01 19:29:32 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-11-07 16:41:37 +0000
commit4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c (patch)
treef10b6a00dfbcd061da160a63007fbe7c593f6501 /lib
parentName, rather than number, shared_ptr tests (diff)
downloadilt-4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c.tar.bz2
ilt-4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c.tar.xz
ilt-4a4a45e9a4a881a6c9a30722089bec7d3cc07e8c.zip
Error on bad cast of referenced object
Diffstat (limited to 'lib')
-rw-r--r--lib/persistence.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/persistence.h b/lib/persistence.h
index 86b0dce..e8e3415 100644
--- a/lib/persistence.h
+++ b/lib/persistence.h
@@ -303,6 +303,9 @@ namespace Persistence {
if (auto teo = std::dynamic_pointer_cast<T>(sharedObjects.at(id))) {
this->v = std::move(teo);
}
+ else {
+ throw std::runtime_error("Named type doesn't cast to target type");
+ }
}
};
}