title: Is it possible to suppress the stack trace from a thrown Exception in groovy declarative pipelines?
body: <p>I have a declarative pipeline with an input step where it is possible to put the wrong input. I have wrapped the stage in a retry block and thrown Exceptions if the input is found to be invalid.</p>
  <pre><code>if (isValid == 1) {
     println(&quot;Erroring out due to invalid change ticket&quot;)
     throw new Exception(&quot;Please rerun the job and enter a valid change ticket&quot;)
  } else {
     println(&quot;CHG ticket is valid&quot;)
  </code></pre>
  <p>If this exception is thrown the stage is restarted.</p>
  <p>The pipeline console spits this out:</p>
  <pre><code>ERROR: Execution failed
  java.lang.Exception: Please rerun the job and enter a valid change ticket
      at WorkflowScript.run(WorkflowScript:197)
      at ___cps.transform___(Native Method)
      at sun.reflect.GeneratedConstructorAccessor1164.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
      at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
      at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:208)
      at org.kohsuke.groovy.sandbox.GroovyInterceptor.onNewInstance(GroovyInterceptor.java:42)
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onNewInstance(SandboxInterceptor.java:172)
      at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:205)
      at org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:210)
      at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.constructorCall(SandboxInvoker.java:21)
  Retrying
  [Pipeline] {
  [Pipeline] timeout
  Timeout set to expire in 1 day 0 hr
  [Pipeline] {
  [Pipeline] input
  Input requested
  </code></pre>
  <p>But I only care for the message I passed with the Exception.</p>
  <p>Is there a way to suppress the stacktrace from this Exception in the Jenkins console?</p>