Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 3536e87

Browse files
committed
Print more details (with stack trace) when there is an exception in
ClassPathLookup construction. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=207966020
1 parent ab8af87 commit 3536e87

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

build/jarjar.jar

-1 Bytes
Binary file not shown.

src/agent/jvm_internals.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,14 @@ bool JvmInternals::CreateClassPathLookupInstance(
111111
jobject extra_class_path) {
112112
Stopwatch stopwatch;
113113

114-
JniLocalRef instance_local_ref(jni()->NewObject(
115-
class_path_lookup_.cls.get(),
116-
class_path_lookup_.constructor,
117-
use_default_class_path,
118-
extra_class_path));
119-
120-
if (!JniCheckNoException("new ClassPathLookup(...)")) {
121-
return false;
122-
}
114+
JniLocalRef instance_local_ref = CatchOr(
115+
"new ClassPathLookup(...)",
116+
JniLocalRef(jni()->NewObject(
117+
class_path_lookup_.cls.get(),
118+
class_path_lookup_.constructor,
119+
use_default_class_path,
120+
extra_class_path)))
121+
.Release(ExceptionAction::LOG_AND_IGNORE);
123122

124123
if (instance_local_ref == nullptr) {
125124
return false;

0 commit comments

Comments
 (0)