Skip to content

Commit

Permalink
Oops, fix parameter naming (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
forest-code42 authored Mar 28, 2024
1 parent 9055898 commit 621d829
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ import com.code42.jenkins.pipelinekt.internal.step.scripted.Try

@Suppress("UnusedPrivateMember")
fun DslContext<Step>.`try`(
trySteps: DslContext<Step>.() -> Unit,
`catch`: (DslContext<Step>.() -> Unit)?
trySteps: DslContext<Step>.() -> Unit,
catchSteps: (DslContext<Step>.() -> Unit)?
) {
tryCatch(trySteps, `catch`)
tryCatch(trySteps, catchSteps)
}

fun DslContext<Step>.tryCatch(
tryStep: DslContext<Step>.() -> Unit,
catchStep: (DslContext<Step>.() -> Unit)?
tryStep: DslContext<Step>.() -> Unit,
catchStep: (DslContext<Step>.() -> Unit)?
) {
val trySteps = DslContext.into(tryStep).toStep()
if(catchStep != null) {
if (catchStep != null) {
val catchSteps = DslContext.into(catchStep).toStep()
add(Try(trySteps, catchSteps))
} else {
add(Try(trySteps, null))
}
}

0 comments on commit 621d829

Please sign in to comment.