Unable to print stacktrace on jenkins pipeline

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      When attempting to print a stacktrace of an error in pipeline I've encountered a problem.

       

      If I make a try/catch block to catch the error and I use the printStackTrace function in the catch block the stacktrace is not printed to the console output (I assume it's because it's printed to stderr but I couldn't find a way around that) 

       

      An example code:

       

       

      node() {
        try {
           throw "error"
        } catch (err) {
           err.printStackTrace()
        }
      }

       

       

            Assignee:
            Unassigned
            Reporter:
            Uri Ende
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: