code: @SuppressWarnings("checkstyle:illegalcatch") // Catch throwable to feed it to error handler
    public static REEFEnvironment fromConfiguration(
        final UserCredentials hostUser, final Configuration... configurations) throws InjectionException {
  
      final Configuration config = Configurations.merge(configurations);
  
      if (LOG.isLoggable(Level.FINEST)) {
        LOG.log(Level.FINEST, "Configuration:\n--\n{0}\n--", Configurations.toString(config, true));
      }
  
      final Injector injector = TANG.newInjector(config);
  
      if (ProfilerState.isProfilingEnabled(injector)) {
        final WakeProfiler profiler = new WakeProfiler();
        ProfilingStopHandler.setProfiler(profiler);
        injector.bindAspect(profiler);
      }
  
      injector.getInstance(REEFVersion.class).logVersion();
  
      final REEFErrorHandler errorHandler = injector.getInstance(REEFErrorHandler.class);
      final JobStatusHandler jobStatusHandler = injector.getInstance(JobStatusHandler.class);
  
      if (hostUser != null) {
        try {
          injector.getInstance(UserCredentials.class).set("reef-proxy", hostUser);
        } catch (final IOException ex) {
          final String msg = "Cannot copy user credentials: " + hostUser;
          LOG.log(Level.SEVERE, msg, ex);
          throw new RuntimeException(msg, ex);
        }
      }
  
      try {
  
        final Clock clock = injector.getInstance(Clock.class);
        return new REEFEnvironment(clock, errorHandler, jobStatusHandler);
  
      } catch (final Throwable ex) {
        LOG.log(Level.SEVERE, "Error while instantiating the clock", ex);
        try {
          errorHandler.onNext(ex);
        } catch (final Throwable exHandling) {
          LOG.log(Level.SEVERE, "Error while handling the exception " + ex, exHandling);
        }
        throw ex;
      }
    }
docs: Create a new REEF environment.
  @param hostUser User credentials to use when registering REEF app with the Resource Manager.
  This parameter may be required for Unmanaged AM mode. Can be null.
  @param configurations REEF component (Driver or Evaluator) configuration.
  If multiple configurations are provided, they will be merged before use.
  Main part of the configuration is usually read from config file by REEFLauncher.
  @throws InjectionException Thrown on configuration error.