# getOrThrow<T, X extends Throwable> abstract method

T getOrThrow<T, X extends Throwable>(

1. Class<T> type,
2. Supplier<X> exceptionSupplier

)

Returns an instance of the given `type` if registered.

If not registered, throws the exception provided by `exceptionSupplier`.

Example:

    final Logger logger = context.getOrElseThrow(
      Class<Logger>(),
      () => ConfigurationException('Logger not found')
    );

## Implementation

    T getOrThrow<T, X extends Throwable>(Class<T> type, Supplier<X> exceptionSupplier);