Does anyone know the right way to raise a `Contain...
# ask-the-community
a
Does anyone know the right way to raise a
ContainerError
inside a task using flytekit python? https://docs.flyte.org/projects/flyteidl/en/latest/protos/docs/core/core.html#ref-flyteidl-core-containererror For example, if I want to raise/return
NON_RECOVERABLE
or
RECOVERABLE
depends of the task logic
k
https://docs.flyte.org/projects/flytekit/en/latest/design/authoring.html Cc @Samhita Alla / @David Espejo (he/him) this page is not rendering well
a
so if it is the case:
Copy code
@task
def t1(a: int) -> op:
    raise FlyteRecoverableException("error")
    return op(a + 2, "world")
This is a recoverable task and flyte should retry it, right?
k
Are you seeing it otherwise - suspense 馃槵
a
I'm seeing this:
Copy code
Traceback (most recent call last):

      File "/usr/src/app/.venv/lib/python3.8/site-packages/flytekit/exceptions/scopes.py", line 203, in user_entry_point
        return wrapped(*args, **kwargs)
      File "/usr/src/app/andresg_wf_testing/test.py", line 14, in t1
        raise FlyteRecoverableException("error")

Message:

    error

User error.
but the task only tried to do one attempt 馃槙
k
Do you have retries set
a
yeah! you are right 馃檲 sorry
and thank you 馃檪
k
anytime
s
@Ketan (kumare3), created a PR to fix the authoring structure page. https://github.com/flyteorg/flytekit/pull/1572
k
Can you improve the description- mark things and then +1
s
I haven't understood, Ketan. What is it that I should change?
152 Views