Give clear error when sexp module not available

Instead of falling through to YAML parsing (which gives confusing errors),
return a clear message that artdag.sexp is required but not installed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-11 23:17:55 +00:00
parent 0ead728fde
commit 24b6b4af28
2 changed files with 9 additions and 3 deletions

View File

@@ -73,7 +73,9 @@ async def upload_recipe(
variable_inputs = []
fixed_inputs = []
if is_sexp and SEXP_AVAILABLE:
if is_sexp:
if not SEXP_AVAILABLE:
raise HTTPException(500, "S-expression recipes require artdag.sexp module (not installed on server)")
# Parse S-expression
try:
compiled = compile_string(content)