You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to add an ErrorEvent to nicely handle errors in the error EventListener. I understand with promises we can always reject Promise and throw errors that we cannot escape, but for other "minor" errors it's good to handle the onerror EventListener. It will help us to distinguish different kinds of errors, temporary vs permanent, etc.
constvideoDecoder=newVideoDecoder({output: someCanvas});videoDecoder.configure({codec: 'vp8'}).then(()=>{streamEncodedChunks(videoDecoder.decode.bind(videoDecoder));}).catch(()=>{// App provides fallback logic when config not supported.
...
});
...
videoDecoder.onerror=event=>{console.log("Error! ");};ORvideoDecoder.addEventListener('error',error=>console.log(`Error: ${error.name}`));
You want this as a global error handler? Like will the event also fire for rejected promises? Would be good to check what the precedent is for this behavior
API has changed a lot since this was filed. There are now two types of errors and they're surfaced in different ways.
Non-fatal errors are detected synchronously in response to an API call and surfaced via exception. An example would be calling configure() or decode() with inputs that are missing required parameters. The state of the codec is not altered by these errors.
Fatal errors are detected while decoding/encoding, surfaced via the error callback. Generally these are codec errors, often caused by corrupt input.
Please open new issues for feedback on this design.
Activity
kenchris commentedon May 18, 2020
You want this as a global error handler? Like will the event also fire for rejected promises? Would be good to check what the precedent is for this behavior
dalecurtis commentedon May 20, 2020
As noted in the meeting, since the rest of the API uses callbacks, I don't think we should mixin events for consistency.
chcunningham commentedon Oct 22, 2020
API has changed a lot since this was filed. There are now two types of errors and they're surfaced in different ways.
Non-fatal errors are detected synchronously in response to an API call and surfaced via exception. An example would be calling configure() or decode() with inputs that are missing required parameters. The state of the codec is not altered by these errors.
Fatal errors are detected while decoding/encoding, surfaced via the error callback. Generally these are codec errors, often caused by corrupt input.
Please open new issues for feedback on this design.