From fd2f79200f469602d14bf611bca5bd40d757ba6e Mon Sep 17 00:00:00 2001 From: Maximilien Colange Date: Tue, 22 Nov 2016 10:46:49 +0100 Subject: [PATCH] Improve error messages when loading compiled models. * spot/ltsmin/ltsmin.cc: Improve error messages. --- spot/ltsmin/ltsmin.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spot/ltsmin/ltsmin.cc b/spot/ltsmin/ltsmin.cc index 955aaaf01..c79b2bf77 100644 --- a/spot/ltsmin/ltsmin.cc +++ b/spot/ltsmin/ltsmin.cc @@ -1017,9 +1017,10 @@ namespace spot lt_dlhandle h = lt_dlopen(file.c_str()); if (!h) { + std::string lt_error = lt_dlerror(); lt_dlexit(); throw std::runtime_error(std::string("Failed to load '") - + file + "'."); + + file + "'.\n" + lt_error); } auto d = std::make_shared(); @@ -1106,7 +1107,7 @@ namespace spot && d->get_type_name && d->get_type_value_count && d->get_type_value_name)) - throw std::runtime_error(std::string("Failed resolve some symbol" + throw std::runtime_error(std::string("Failed to resolve some symbol " "while loading '") + file + "'."); if (d->have_property && d->have_property())