Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFLY-10076] Add a more verbose description on the IllegalStateException #11308

Merged
merged 1 commit into from
Jun 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,7 @@ public interface WeldLogger extends BasicLogger {
@Message(id = 55, value = "Could not index class [%s] from an external bean archive: %s")
void cannotIndexClassName(Object name, Object bda);

@Message(id = 56, value = "Weld is not initialized yet")
IllegalStateException weldNotInitialized();

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import javax.naming.NamingException;

import org.jboss.as.weld.deployment.WeldDeployment;
import org.jboss.as.weld.logging.WeldLogger;
import org.jboss.as.weld.services.ModuleGroupSingletonProvider;
import org.jboss.as.weld.util.Reflections;
import org.jboss.weld.AbstractCDI;
Expand Down Expand Up @@ -63,7 +64,7 @@ static void containerShutDown(Container container) {
@Override
public CDI<Object> getCDI() {
if (ModuleGroupSingletonProvider.deploymentClassLoaders.isEmpty()) {
throw new IllegalStateException();
throw WeldLogger.ROOT_LOGGER.weldNotInitialized();
}
final Container container = Container.instance();
checkContainerState(container);
Expand Down