// SPDX-License-Identifier: BSD-2-Clause // author: Max Kellermann #include "Exception.hxx" #include "Object.hxx" #include "String.hxx" Java::Exception::Exception(JNIEnv *env, jthrowable e) noexcept :std::runtime_error(Java::String(env, Object::toString(env, e)).ToString()) { } void Java::RethrowException(JNIEnv *env) { LocalRef exception{env, env->ExceptionOccurred()}; if (!exception) return; env->ExceptionClear(); throw Exception(env, exception); }