From 40dd4ea8535ea27edc464b6aee85a925f8350f62 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Fri, 30 Jun 2023 10:37:26 +0200 Subject: [PATCH] Use the message of the exception instead of using our own. --- lib/src/main/cpp/macros.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/main/cpp/macros.h b/lib/src/main/cpp/macros.h index 7ce1543..ec276ff 100644 --- a/lib/src/main/cpp/macros.h +++ b/lib/src/main/cpp/macros.h @@ -45,13 +45,13 @@ JNIEXPORT retType JNICALL BUILD_METHOD(TYPENAME ,name) ( \ #define CATCH_EXCEPTION(RET) \ catch(const zim::ZimFileFormatError& e) { \ - throwException(env, "org/kiwix/libzim/ZimFileFormatException", "Zim file format error."); \ + throwException(env, "org/kiwix/libzim/ZimFileFormatException", e.what()); \ return RET; \ } catch(const zim::InvalidType& e) { \ - throwException(env, "java/lang/Exception", "Invalid type."); \ + throwException(env, "java/lang/Exception", e.what()); \ return RET; \ } catch(const zim::EntryNotFound& e) { \ - throwException(env, "java/lang/Exception", "Entry Not Found."); \ + throwException(env, "java/lang/Exception", e.what()); \ return RET; \ } catch (const std::ios_base::failure& e) { \ throwException(env, "java/io/IOException", e.what()); \