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

[WIP] Improving error handling messages for Custom Functions #1330

Merged
merged 9 commits into from
Nov 6, 2023
Prev Previous commit
Next Next commit
Added comments for the types of exceptions caught
  • Loading branch information
hershd23 committed Nov 4, 2023
commit f893700cf32c488e5779daa2cf3292e1687f1fe8
2 changes: 2 additions & 0 deletions evadb/utils/generic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ def load_function_class_from_file(filepath, classname=None):
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
except ImportError as e:
# ImportError in the case when we are able to find the file but not able to load the module
err_msg = f"Couldn't load function from {filepath} : {str(e)}. Not able to load the code provided in the file {abs_path}. Please ensure that the file contains the implementation code for the function."
raise RuntimeError(err_msg)
except FileNotFoundError as e:
# FileNotFoundError in the case when we are not able to find the file at all at the path.
err_msg = f"Couldn't load function from {filepath} : {str(e)}. This might be because the function implementation file does not exist. Please ensure the file exists at {abs_path}"
raise RuntimeError(err_msg)
except Exception as e:
Expand Down