CustomMembersHolder (@NotNull GroovyClassDescriptor descriptor) { final ProcessingContext ctx = new ProcessingContext(); ctx.put(GdslUtil.INITIAL_CONTEXT, descriptor); try { if (!isApplicable(executor, descriptor, ctx)) { return CustomMembersHolder.EMPTY; } return executor.processVariants(descriptor, ctx); } catch (InvokerInvocationException e) { Throwable cause = e.getCause(); if (cause instanceof ProcessCanceledException) { throw (ProcessCanceledException)cause; } if (cause instanceof OutOfMemoryError) { throw (OutOfMemoryError)cause; } handleDslError(e); } catch (ProcessCanceledException | OutOfMemoryError e) { throw e; } catch (Throwable e) { // To handle exceptions in definition script handleDslError(e); } return CustomMembersHolder.EMPTY; }