What does `retry`, `timeout` and `catchError` do in a pipeline?

IntermediateConceptJenkins
Answer

retry(n) re-runs the enclosed steps up to n times on failure (good for flaky network steps, not for hiding flaky tests). timeout aborts the enclosed block when time runs out. catchError lets a failure mark the build as FAILURE or UNSTABLE while the pipeline keeps going, useful for optional steps.

retry(3) { sh 'curl -fsS https://registry.example.com/healthz' }
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
  sh './optional-scan.sh'
}
All CI/CD questions

More on Jenkins