public class DeferredException extends Object implements AutoCloseable
This class is thread safe.
| Constructor and Description |
|---|
DeferredException()
Constructor.
|
DeferredException(org.apache.drill.shaded.guava.com.google.common.base.Supplier<Exception> exceptionSupplier)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addException(Exception exception)
Add an exception.
|
void |
addThrowable(Throwable throwable) |
void |
close() |
Exception |
getAndClear() |
Exception |
getException()
Get the deferred exception, if there is one.
|
void |
suppressingClose(AutoCloseable autoCloseable)
Close the given AutoCloseable, suppressing any exceptions that are thrown.
|
void |
throwAndClear()
If an exception exists, will throw the exception and then clear it.
|
public DeferredException()
public DeferredException(org.apache.drill.shaded.guava.com.google.common.base.Supplier<Exception> exceptionSupplier)
exceptionSupplier - lazily supplies what will be the root exception
if any exceptions are addedpublic void addException(Exception exception)
exception - the exception to addpublic void addThrowable(Throwable throwable)
public Exception getException()
public Exception getAndClear()
public void throwAndClear()
throws Exception
Exceptionpublic void suppressingClose(AutoCloseable autoCloseable)
addException(Exception)
are followed.autoCloseable - the AutoCloseable to close; may be nullpublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.