Skip to content

Parameter to make apoc.periodic.iterate() raise an error when any batch fails #284

Closed
@johnlinp

Description

@johnlinp

Feature description (Mandatory)

I'm using apoc.periodic.iterate() to iterate nodes and perform actions on each node. Sometimes, some of the actions would fail. However, when any action fails, the call to apoc.periodic.iterate() is still successful. Therefore, the queries following the call will still be executed. I find it inconvenient because I don't want the following queries to be executed when the call to apoc.periodic.iterate() fails. In addition to that, I'm using cypher-shell command to execute by queries, and I want cypher-shell to exit with a non-zero status code if any of the action fails in the call to apoc.periodic.iterate().

My proposal is to add a parameter (e.g. raiseErrorWhenAnyBatchFail) to apoc.periodic.iterate(), so I can config it to raise an error when any batch fails. That way, it can prevent the following queries to be executed and make cypher-shell exit with a non-zero status code when error occurs.

Considered alternatives

I know that I can check the output parameters failedOperations and failedBatches that returned from the call to apoc.periodic.iterate() to know if the call has failed or not, but I didn't find any way to raise an error with the help of these 2 output parameters.

How this feature can improve the project?

I guess it's a feature request that other people would find helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions