[JIRA] (JENKINS-35308) Improve display of non-AbortException stack traces such as MissingPropertyException

2019-06-14 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick commented on  JENKINS-35308  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Improve display of non-AbortException stack traces such as MissingPropertyException   
 

  
 
 
 
 

 
 JENKINS-31838 already tracks the poor filenames in stack traces.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.171017.1464884876000.1155.1560558000299%40Atlassian.JIRA.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-35308) Improve display of non-AbortException stack traces such as MissingPropertyException

2019-06-14 Thread cowlina...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 p cowlinator commented on  JENKINS-35308  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Improve display of non-AbortException stack traces such as MissingPropertyException   
 

  
 
 
 
 

 
 "People who get stuck here, check for WorkflowScript in your stack traces. That's your Jenkinsfile." This.  This should be documented in large font on the main Pipeline/Jenkinsfile documentation home page.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.171017.1464884876000.1138.1560553440266%40Atlassian.JIRA.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-35308) Improve display of non-AbortException stack traces such as MissingPropertyException

2018-10-22 Thread cr...@2ndquadrant.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Craig Ringer commented on  JENKINS-35308  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Improve display of non-AbortException stack traces such as MissingPropertyException   
 

  
 
 
 
 

 
 People who get stuck here, check for WorkflowScript in your stack traces. That's your Jenkinsfile. This has caused me a lot of difficulty as I learn to work with pipelines, though knowing the above makes life much easier. So a big +1 for improving it. *I worked around it in my pipelines; see below for code*. The simplest improvement would be to use [StackTraceUtils](http://docs.groovy-lang.org/latest/html/api/org/codehaus/groovy/runtime/StackTraceUtils.html) to sanitize the Groovy stuff. It could also use `StackTraceUtils.addClassTest(...)` to filter out some limited Jenkins and pipeline internals, though some care is needed not to remove important info "above" the application failure. Can't Jenkins potentially just walk the stack trace and transform `WorkflowScript` to the `${pipeline-script}` name, or annotate the name with the script-name?  That alone would be a huge help, and pretty simple. Bonus points for abbreviating stack traces at `WorkflowScript.run`with a `...` - the rest of the stack isn't really that interesting if you know you got to the point of successful pipeline execution. I tried to work around it in my Groovy scripts with an outer try/catch block in which I ran: 

 

try {
  // pipeline here
} catch (e) {
  currentBuild.result = 'FAILURE'
  StackTraceUtils.sanitize(e)
  throw e
}
 

 ... but it doesn't seem to remove anything much. Even when I add my own class filters (see below). Using `StackTraceUtils.printSanitizedStackTrace(e)` has the same effect. Note that the docs for StackTraceUtils.sanitize appear to be wrong. It doesn't return the exception - it returns null. Attempting to 

 

   // this is wrong, do not do this
   throw StackTraceUtils.sanitize(e)
 

 will yield the amazingly uninformative exception: 

 
java.lang.NullPointerException
	at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:42)

 

 when you try to throw null. I also wrote a filter to cut some of the crud out: 

 

StackTraceUtils.addClassTest({
  def result
  switch (it) {
/* The Jenkinsfile itself */
case 'WorkflowScript':
  result = true
  break
/* Innards we don't care about */
case ~/^org.jenkinsci.plugins.workflow/:
  result = false
  break
case ~/^org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox/:
  result = false
  break
case ~/^hudson.remoting/:
  result = false
  break
case 

[JIRA] (JENKINS-35308) Improve display of non-AbortException stack traces such as MissingPropertyException

2016-08-29 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-35308  
 
 
  Improve display of non-AbortException stack traces such as MissingPropertyException   
 

  
 
 
 
 

 
Change By: 
 Jesse Glick  
 
 
Component/s: 
 workflow-cps-plugin  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-35308) Improve display of non-AbortException stack traces such as MissingPropertyException

2016-08-29 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-35308  
 
 
  Improve display of non-AbortException stack traces such as MissingPropertyException   
 

  
 
 
 
 

 
Change By: 
 Jesse Glick  
 
 
Component/s: 
 workflow-job-plugin  
 
 
Component/s: 
 pipeline  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.