MCPcopy Create free account
hub / github.com/Snapchat/Valdi / newValdiException

Function newValdiException

valdi_core/src/valdi_core/jni/JavaUtils.cpp:250–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250static djinni::LocalRef<jobject> newValdiException(JavaEnv env, const Valdi::Error& error) {
251 auto convertedMessage = toJavaObject(env, error.getMessage());
252 // Carry the code when there is one, so a cancellation stays distinguishable from a genuine
253 // failure on the Kotlin side (see Throwable.valdiErrorCode) instead of only the message
254 // surviving. Errors without a code keep using the message-only constructor.
255 const auto errorCode = error.getErrorCode();
256 if (errorCode != 0) {
257 return JavaEnv::getCache().getValdiExceptionClass().newObject(

Callers 2

toJavaObjectFunction · 0.85
toJavaThrowableFunction · 0.85

Calls 3

toJavaObjectFunction · 0.85
getMessageMethod · 0.65
newObjectMethod · 0.45

Tested by

no test coverage detected