kibana/vars/catchErrors.groovy

16 lines
439 B
Groovy
Raw Normal View History

2020-03-02 21:04:27 +01:00
// Basically, this is a shortcut for catchError(catchInterruptions: false) {}
// By default, catchError will swallow aborts/timeouts, which we almost never want
// Also, by wrapping it in an additional try/catch, we cut down on spam in Pipeline Steps
2020-03-02 21:04:27 +01:00
def call(Map params = [:], Closure closure) {
try {
closure()
} catch (ex) {
params.catchInterruptions = false
catchError(params) {
throw ex
}
}
2020-03-02 21:04:27 +01:00
}
return this