aws-samples / aws-samples/sample-spec-driven-presentation-maker
refactor: consolidate error handling between strandsParser and ChatPanel
- Dominant language
- Python
- Stars
- 128
- Forks
- 10
- Avg merge
- 4d 40m
- Merged PRs (30d)
- 8
Description
## Background
PR #118 added agent-level error display to fix the infinite spinner issue.
The implementation works correctly but has some structural improvements to make.
## Tasks
- [ ] Extract error classification into a shared utility (e.g. `classifyAgentError(message)`)
- Returns error type: `conversation_limit` | `throttling` | `timeout` | `not_ready` | `service_unavailable` | `generic`
- Single source of truth for string matching logic
- [ ] Move UI display messages out of `strandsParser.js` into the UI layer
- Parser returns error type/code, ChatPanel decides display text
- [ ] Unify error display behavior: message replacement (not concatenation to `currentCompletion`)
- [ ] (Nice to have) Add `error_code` field to backend SSE error events to reduce reliance on string matching
## Context
- strandsParser.js: 5 error categories with emoji-prefixed messages
- ChatPanel.tsx: 3 categories (retryable / conversation-limit / generic)
- Current concatenation: `currentCompletion + errorMessage` may produce awkward output if partial response exists
## Related
- #118
Contributor guide
Assessment
This issue has not been assessed yet.