public class ModuleSetupRuntimeException extends RuntimeException
Also used in Lifecycle.init()
and Lifecycle.destroy()
, because
those methods are typically called from DI's Wiring classes (typically implicitly
by a DI framework, and not hand-written Wiring code).
For example, throw this from methods in a class implementing Guice's Module interface, or from methods annotated with Dagger's @Provides in a @Module class, which "may only throw unchecked exceptions". In particular, when you have to catch checked exceptions while creating objects, wrap them into this unchecked Exception.
When you use this Exception in a Dagger/Guice/etc. Module, you should probably write a simple test for the Module, just to verify it (alone) works at run-time (if there is a checked exception to catch, it probably initializes something that is non-trivial and could fail; so best to have a non-regression test for that Module).
Constructor and Description |
---|
ModuleSetupRuntimeException(Exception cause) |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ModuleSetupRuntimeException(Exception cause)
Copyright © 2019 OpenDaylight. All rights reserved.