AOSSIE-Org / AOSSIE-Org/Ell-ena
BUG:Unsafe JSON Decoding->the API returns a 500 error (HTML body) or network error, the app will crash.
- Dominant language
- Dart
- Stars
- 54
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### What happened?
### Unsafe JSON Decoding
- **Where**: `AIService.generateChatResponse`
- **Issue**: jsonDecode(response.body) is called without a try-catch block. If the API returns a 500 error (HTML body) or network error, the app will crash.
- **Fix**: Check response.statusCode before decoding and use try-catch.
- **why**?If the API returns a 500 error (HTML body) or network error, the app will crash.
@SharkyBytes Please checkout the fix here
### Record
- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.