https://flyte.org logo
#ask-the-community
Title
# ask-the-community
y

Yubo Wang

02/16/2023, 12:56 AM
Hi community, does anyone know how to throw an exception to be user exception within the execute function when writing backend plugin?
k

Ketan (kumare3)

02/16/2023, 2:39 AM
You can - return the error object in output writer
y

Yubo Wang

02/16/2023, 2:40 AM
can I do something like def execute(): exception_scopes.user_entry_point(execute_helper())
k

Ketan (kumare3)

02/16/2023, 6:37 AM
Are you talking about backend plugin or python flytekit
y

Yubo Wang

02/16/2023, 6:46 AM
TFJob, so it is a backend plugin
but it is a pythoninstanceTask since we handle the actual execution
I think this should work
k

Ketan (kumare3)

02/16/2023, 7:12 AM
Ohh you want the user side to raise exception
Yes you can raise anything, but if you want a nice error - https://github.com/flyteorg/flytekit/blob/master/flytekit/exceptions/user.py
If you raise system - you will see it marked as system exception in UI
8 Views