Skip to content

Commit

Permalink
Fix deployment exception transformer
Browse files Browse the repository at this point in the history
Helidon config causes some deployment errors to present as a
"CDI definition failure", rather than a "CDI deployment failure".

The Arquillian extension to transform exceptions has been made
more generic to allow this.

Signed-off-by: Matthew Gill <matthew.gill@live.co.uk>
  • Loading branch information
MattGill98 committed Jun 10, 2022
1 parent 2b09c7a commit b56317a
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -20,15 +20,14 @@

/**
* The common GlassFishClientCommon handler will always throw a GlassfishClientException,
* with a message from the response. Since Glassfish prefixes errors with "CDI deployment failure"
* when a CDI deployment error is thrown, we can safely convert this error to the expected
* with a message from the response. Deployment errors can safely be converted to the expected
* exception type.
*/
public class ConfigDeploymentExceptionTransformer implements DeploymentExceptionTransformer {

@Override
public Throwable transform(Throwable throwable) {
if (throwable != null && throwable.getMessage().contains("CDI deployment failure")) {
if (throwable != null && throwable.getMessage().contains("Error occurred during deployment")) {
return new DeploymentException(throwable);
}
return throwable;
Expand Down

0 comments on commit b56317a

Please sign in to comment.