diff options
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r-- | runtime/thread.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc index 3e83f654b5..d5aea19e87 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -4280,8 +4280,16 @@ ScopedExceptionStorage::ScopedExceptionStorage(art::Thread* self) self_->ClearException(); } +void ScopedExceptionStorage::SuppressOldException(const char* message) { + CHECK(self_->IsExceptionPending()) << *self_; + ObjPtr<mirror::Throwable> old_suppressed(excp_.Get()); + excp_.Assign(self_->GetException()); + LOG(WARNING) << message << "Suppressing old exception: " << old_suppressed->Dump(); + self_->ClearException(); +} + ScopedExceptionStorage::~ScopedExceptionStorage() { - CHECK(!self_->IsExceptionPending()) << self_; + CHECK(!self_->IsExceptionPending()) << *self_; if (!excp_.IsNull()) { self_->SetException(excp_.Get()); } |