[introspection] Improve error message when failing to find a native library. (#2573)

This commit is contained in:
Rolf Bjarne Kvinge 2017-08-31 19:35:47 +02:00 коммит произвёл Sebastien Pouliot
Родитель 49fa0ca724
Коммит f90655bd05
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -232,7 +232,10 @@ namespace Introspection {
string path = FindLibrary (f.LibraryName);
IntPtr lib = Dlfcn.dlopen (path, 0);
if (Dlfcn.GetIndirect (lib, name) == IntPtr.Zero) {
if (lib == IntPtr.Zero) {
ReportError ("Could not open the library '{0}' to find the field '{1}': {2}", path, name, Dlfcn.dlerror ());
failed_fields.Add (name);
} else if (Dlfcn.GetIndirect (lib, name) == IntPtr.Zero) {
ReportError ("Could not find the field '{0}' in {1}", name, path);
failed_fields.Add (name);
}