| 277 | // surviving. Errors without a code keep using the message-only constructor. |
| 278 | const auto errorCode = error.getErrorCode(); |
| 279 | if (errorCode != 0) { |
| 280 | return JavaEnv::getCache().getValdiExceptionClass().newObject( |
| 281 | JavaEnv::getCache().getValdiExceptionConstructorWithErrorCodeMethod(), |
| 282 | std::move(convertedMessage), |
| 283 | errorCode); |
| 284 | } |
| 285 | return JavaEnv::getCache().getValdiExceptionClass().newObject( |
| 286 | JavaEnv::getCache().getValdiExceptionConstructorMethod(), std::move(convertedMessage)); |
| 287 | } |
| 288 | |
| 289 | JavaObject toJavaObject(JavaEnv env, const Valdi::Error& error) { |
| 290 | return JavaObject(env, newValdiException(env, error)); |
| 291 | } |
| 292 | |
| 293 | Throwable toJavaThrowable(JavaEnv env, const Valdi::Error& error) { |
no test coverage detected