Use the message of the exception instead of using our own.

This commit is contained in:
Matthieu Gautier 2023-06-30 10:37:26 +02:00
parent c36a29abc4
commit 40dd4ea853

View File

@ -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()); \