Comcast / Comcast/scte35-js

Handle parse errors gracefully

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.