I’ve run into some situations when the build fails, perhaps because some processes don’t finish, and even setting a timeout doesn’t make the Jenkins job fail.
So, to fix this problem, I used try
.. catch
and error
to make my Jenkins job failed, hopes this also helps you.
Please see the following example:
pipeline { |
Here is the output log
00:00:01.326 [Pipeline] Start of Pipeline |