This message was deleted.
# community-support
s
This message was deleted.
e
not sure what you mean.
gradle.startParameter.isContinueOnFailure
?
j
but this would be for all tasks running in that build right? I want to ignore only one of them
e
well if you want a task to not fail, you could probably do something horrible like
Copy code
task.configure {
    val existingActions = actions
    val wrappedAction = Action<Task> {
        try {
            for (action in existingActions) action.execute(this)
        } catch (e: RuntimeException) {
            logger.error("Exception: ", e)
        }
    }
    actions = listOf(wrappedAction)
}
but I don't think there's a way to simulate `--continue`'s behavior of "on failure, continue building other non-dependents, but don't build dependents and fail the build at the end" on just a single task
j
I was imagining that. The use case was avoiding crashing when creating two networks with the same name with a docker plugin. But I found it is exposing a docker client and I can check if the network exists on
onlyIf
which should be a better approach. Thank you anyway 🙂
v
Yes, using
onlyIf
seems better in that case. But other than that, there are some tasks that explicitly support such a configuration like test tasks that have a property for not failing on failed tests. But other than that, just what @ephemient shows, wrapping the actions, catching exceptions.
e
docker usage seems like it would be better handled with a shared build service. in your case, wouldn't there still be potential concurrency issues with
onlyIf
?
j
Not sure tbh as I am using a third party Gradle plugin. All I have tested is working currently, but maybe if two task run in parallel I can get a concurrency issue, currently I only have one