Description
The current code doesn't handle cases where the API might be down, the network is unavailable, or the API returns an error. We should add proper error handling to show users a friendly message instead of breaking silently.
Acceptance Criteria
Technical Details
Consider these error scenarios:
- Network is offline
- API returns 404 for invalid advice slip ID
- API is temporarily unavailable
- Malformed JSON response
Files to Modify
Resources/References
Estimated Difficulty: Beginner Friendly ⭐
Additional Notes
Great for learning error handling patterns in JavaScript. Start with simple console.log statements and alert messages!
Description
The current code doesn't handle cases where the API might be down, the network is unavailable, or the API returns an error. We should add proper error handling to show users a friendly message instead of breaking silently.
Acceptance Criteria
Technical Details
Consider these error scenarios:
Files to Modify
scripts/advice.js- Add try/catch and error handlingscripts/luckyNumberAdvice.js- Add try/catch and error handlingResources/References
Estimated Difficulty: Beginner Friendly ⭐
Additional Notes
Great for learning error handling patterns in JavaScript. Start with simple console.log statements and alert messages!