Skip to content

Commit de6c4cc

Browse files
committed
Catch errors if the model name isn't found
1 parent 44590ab commit de6c4cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ad.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ def run_ad(args):
103103

104104
def get_model_definition(model_key):
105105
"""Get the model definition from the file that contains it."""
106-
return Path(f"models/{model_key}.jl").read_text().strip()
106+
try:
107+
return Path(f"models/{model_key}.jl").read_text().strip()
108+
except FileNotFoundError:
109+
return (f"Model definition not found for `{model_key}`;
110+
f" if you see this error, please open an issue.")
107111

108112

109113
def html(_args):

0 commit comments

Comments
 (0)