Handle exception in libsearch