use of javax.enterprise.inject.InjectionException in project minijax by minijax.
the class EntityProvider method get.
@Override
public T get() {
final MinijaxRequestContext context = MinijaxRequestContext.getThreadLocal();
final InputStream entityStream = context.getEntityStream();
try {
return getImpl(context, entityStream);
} catch (final IOException ex) {
throw new InjectionException(ex.getMessage(), ex);
}
}
use of javax.enterprise.inject.InjectionException in project minijax by minijax.
the class ConstructorProvider method get.
@Override
public T get() {
try {
final T result = ctor.newInstance(getParams(paramProviders));
initImpl(result);
return result;
} catch (final InvocationTargetException ex) {
final Throwable inner = ex.getCause();
throw new InjectionException(inner.getMessage(), inner);
} catch (final Exception e) {
throw new InjectionException(String.format("Can't instantiate %s", ctor), e);
}
}
Aggregations