summaryrefslogtreecommitdiff
path: root/2005
diff options
context:
space:
mode:
authorschodet2005-04-17 01:45:49 +0000
committerschodet2005-04-17 01:45:49 +0000
commit7fa3d0a763cc4920ca1293de61405f6ae897ecc3 (patch)
tree96be28a529514a242e7ae601f685718a7c93a2c1 /2005
parentf54c30633f1b679679d09214e23cb7cf8474d3c5 (diff)
Ajout d'une exception plus descriptive.
Diffstat (limited to '2005')
-rw-r--r--2005/i/robert/src/config/config_data.tcc5
1 files changed, 4 insertions, 1 deletions
diff --git a/2005/i/robert/src/config/config_data.tcc b/2005/i/robert/src/config/config_data.tcc
index 4abad34..1377b00 100644
--- a/2005/i/robert/src/config/config_data.tcc
+++ b/2005/i/robert/src/config/config_data.tcc
@@ -29,7 +29,10 @@ const T &
ConfigData::get (const std::string &id) const
{
const any &a = get (id);
- return any_cast<T> (a);
+ const T *v = any_cast<T> (&a);
+ if (!v)
+ throw std::runtime_error (id + ": config item with bad type");
+ return *v;
}
/// Ajoute une valeur de configuration, fonction générique. Attention,