you can use post section in pipeline post <https://jenkins.io/doc/book/pipeline/syntax/#post> or you can write try catch in script <https://jenkins.io/doc/book/pipeline/syntax/#script> step.
On Tuesday, October 10, 2017 at 10:43:04 PM UTC+5:30, Peter Berghold wrote: > > I've noticed some "non-deterministic behavior" in my first few pipelines > and I was wondering if there i some sort of try/catch structure I could use > to catch errors. It would sort of look like this: > > try { > sh 'some_unix_command' > } catch { > send_mail('Step foo failed on some_unix_command') > } > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d7d8d8c2-380f-46f1-90c5-d4fc626b0283%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.