Handle parse errors gracefully
- Dominant language
- TypeScript
- Stars
- 51
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes, a malformed base64 or hexadecimal string is provided as input. When this happens, an error like this can happen: ```UnhandledPromiseRejectionWarning: Error: Binary read error sectionLength: 2730 + 3 !== data.length: 15
at parseSCTE35Data```
We need to either have some sort of validation here or maybe even a try catch block and output an error elucidating the reason we were not able to parse the string.
Contributor guide
Research direction
Start at parseSCTE35Data, the entry point named in the error, and reproduce the failure with malformed base64 or hexadecimal input. Trace where the binary read error becomes an unhandled promise rejection. Done means invalid input is validated or produces an explanatory parse error instead of an unhandled rejection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100