Skip to content

Commit

Permalink
Merge pull request #37419 from metacosm/better-client-error
Browse files Browse the repository at this point in the history
Improve error message when the client cannot be created
  • Loading branch information
gsmet committed Dec 4, 2023
2 parents f1b034a + bc01e42 commit 301136e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ public <T> T build(Class<T> aClass) throws IllegalStateException, RestClientDefi

ArcContainer arcContainer = Arc.container();
if (arcContainer == null) {
throw new IllegalStateException("The Reactive REST Client is not meant to be used outside of Quarkus");
throw new IllegalStateException(
"The Reactive REST Client needs to be built within the context of a Quarkus application with a valid ArC (CDI) context running.");
}

RestClientListeners.get().forEach(listener -> listener.onNewClient(aClass, this));
Expand Down

0 comments on commit 301136e

Please sign in to comment.