# Gradle java custom plugin exception

**URL:** <https://discuss.gradle.org/t/gradle-java-custom-plugin-exception/11800>\
**Category:** Help/Discuss\
**Tags:** plugins\
**Created:** [September 22, 2015, 11:40am UTC](https://discuss.gradle.org/t/gradle-java-custom-plugin-exception/11800 "2015-09-22T11:40:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahendra1](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mahendra1](https://discuss.gradle.org/u/mahendra1)\
**Post date:** [September 22, 2015, 11:40am UTC](https://discuss.gradle.org/t/gradle-java-custom-plugin-exception/11800/1 "2015-09-22T11:40:13Z")

</div>

I am developing custom gradle java [plugin.In](http://plugin.In) this I have my extension,plugin and task [classes.In](http://classes.In) task class i am extending DefaultTask class and having task method with TaskAction annotation.I am able to successfully execute my plugin but in wrong case whenever exception is thrown my custom task class in that case gradle terminates program execution by displaying exception stacktrace on screen along with Build success message I want to change this exception stacktrace along with build Failure message.Could you please let me know how to do this I tried throwing stopActionException,TaskExectionException with no luck?could you please help guys?
