fix: return error tuples instead of silent {:ok, ""} in execute_macro (CSM-022)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 09:07:44 +02:00
parent 2be43ca06d
commit a4ecbabc21
3 changed files with 12 additions and 6 deletions

View File

@@ -360,10 +360,12 @@
---
### CSM-022 — Silent Error Swallowing
- **File:** `lib/bds/scripting.ex:64-66`
- **What:** `execute_macro/4` returns `{:ok, ""}` on `{:error, _reason}` with no logging. The caller cannot distinguish success from failure.
- **Fix:** Return the actual error tuple or at least log the failure with `Logger.error/1`.
### ~~CSM-022 — Silent Error Swallowing~~ ✅ FIXED
- **Fixed:** 2026-05-11
- **What was done:**
- `execute_macro/4` now returns `{:error, reason}` instead of `{:ok, ""}` when the underlying script execution fails.
- Added `Logger.warning/1` call that logs the project ID and error reason before returning the error tuple.
- Updated test in `api_test.exs` to assert `{:error, _reason}` instead of `{:ok, ""}` for failing macros.
---