Does anyone know the right way to raise a `Contain...
# flyte-support
e
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
f
https://docs.flyte.org/projects/flytekit/en/latest/design/authoring.html Cc @tall-lock-23197 / @average-finland-92144 this page is not rendering well
❤️ 1
e
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?
f
Are you seeing it otherwise - suspense 😬
e
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 😕
f
Do you have retries set
e
yeah! you are right 🙈 sorry
and thank you 🙂
f
anytime
t
@freezing-airport-6809, created a PR to fix the authoring structure page. https://github.com/flyteorg/flytekit/pull/1572
🎯 2
f
Can you improve the description- mark things and then +1
t
I haven't understood, Ketan. What is it that I should change?
152 Views