Skip to content

FailureStrategy

synapseclient.models.FailureStrategy

Bases: Enum

When storing a large number of items through bulk actions like Project(id="syn123").store() or Folder(id="syn456").store() individual failures may occur. Passing this ENUM will allow you to define how you want to respond to failures.

Source code in synapseclient/models/services/storable_entity_components.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class FailureStrategy(Enum):
    """
    When storing a large number of items through bulk actions like
    `Project(id="syn123").store()` or `Folder(id="syn456").store()` individual failures
    may occur. Passing this ENUM will allow you to define how you want to respond to
    failures.
    """

    RAISE_EXCEPTION = "RAISE_EXCEPTION"
    """An exception is raised on the first failure and all tasks yet to be completed
    are cancelled. The exception will also be logged."""

    LOG_EXCEPTION = "LOG_EXCEPTION"
    """An exception is logged and all tasks yet to be completed continue to be
    processed."""

Attributes

RAISE_EXCEPTION class-attribute instance-attribute

RAISE_EXCEPTION = 'RAISE_EXCEPTION'

An exception is raised on the first failure and all tasks yet to be completed are cancelled. The exception will also be logged.

LOG_EXCEPTION class-attribute instance-attribute

LOG_EXCEPTION = 'LOG_EXCEPTION'

An exception is logged and all tasks yet to be completed continue to be processed.