Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwrap python exceptions in crud procedures #416

Open
joshelser opened this issue Oct 4, 2023 · 0 comments
Open

Unwrap python exceptions in crud procedures #416

joshelser opened this issue Oct 4, 2023 · 0 comments

Comments

@joshelser
Copy link
Contributor

I realized that we are giving an ugly python stacktrace back to the user after the pyCRUD migration work.

In the top of the procedure, we should catch any exception and return back the exception's text rather than raise an unhandled exception. Now, the user sees:

Traceback (most recent call last):
  File "_udf_code.py", line 12, in run_delete
  File "/home/udf/27672521534251782/crud.zip/crud/wh_sched.py", line 285, in delete_warehouse_schedule
    raise ValueError("Cannot delete the last schedule for a warehouse.")
ValueError: Cannot delete the last schedule for a warehouse.
 in function DELETE_WAREHOUSE_SCHEDULE with handler run_delete

They could simply see the following instead:

Cannot delete the last schedule for a warehouse.

Related: we indicate an "error" right now if the procedure does not return NULL. Maybe we should be returning a proper exception? Not sure what is "normal" when it comes to non-SQL procedures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant