Commit bc14124
fix: save error history when pipeline throws exception
The catch block in stopRecording only set error state but didn't save
a history item. When runPipeline itself threw (network failure, JSON
parse error), the recording was lost — no history entry, and the saved
audio file became orphaned.
Fix: hoist audioPath above try block so it's accessible in catch,
then save an error HistoryItem (matching the result.success===false
path). Users now see all failed recordings in History, and audio
files are properly tracked for cleanup.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 13dc60b commit bc14124
1 file changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | 166 | | |
169 | 167 | | |
170 | 168 | | |
| |||
337 | 335 | | |
338 | 336 | | |
339 | 337 | | |
340 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
341 | 352 | | |
342 | 353 | | |
343 | 354 | | |
| |||
0 commit comments