diff --git a/app/routers/recipes.py b/app/routers/recipes.py index 290efdd..38d1eff 100644 --- a/app/routers/recipes.py +++ b/app/routers/recipes.py @@ -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) diff --git a/app/services/recipe_service.py b/app/services/recipe_service.py index fb3c1a4..119e4b2 100644 --- a/app/services/recipe_service.py +++ b/app/services/recipe_service.py @@ -68,7 +68,9 @@ class RecipeService: recipe_data = None is_sexp = _is_sexp_format(content) - if is_sexp and SEXP_AVAILABLE: + if is_sexp: + if not SEXP_AVAILABLE: + return {"error": "S-expression recipes require artdag.sexp module (not installed)", "recipe_id": recipe_id} # Parse as S-expression try: compiled = compile_string(content) @@ -153,7 +155,9 @@ class RecipeService: # Detect format is_sexp = _is_sexp_format(content) - if is_sexp and SEXP_AVAILABLE: + if is_sexp: + if not SEXP_AVAILABLE: + return None, "S-expression recipes require artdag.sexp module (not installed on server)" # Validate S-expression try: compiled = compile_string(content)