SRGSSR / pillarbox-web

Pillarbox is a versatile media playback ecosystem engineered for the web.
https://srgssr.github.io/pillarbox-web-demo/
MIT License
11 stars 1 forks source link

feat(srgssr-middleware): use metadata instead of cause when an error occurs #187

Closed amtins closed 7 months ago

amtins commented 7 months ago

Description

Video.js in version 8.11.1 offers the possibility of providing more detail when an error occurs. To this end, the metadata property, which is an object, has been added. This object also has an errorType property, giving more context on the error that has occurred. Finally, the metadata object can host any other custom property.

Pillarbox has a similar mechanism, except that instead of naming the metadata property, it's called cause and has a type property. The term cause has been borrowed directly from the Error object, so as not to introduce a new term.

However, to remain consistent with video.js, the term cause has been dropped in favor of metadata.

Changes made

github-actions[bot] commented 7 months ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements 98.39% 489/497
🟒 Branches 93.44% 228/244
🟒 Functions 100% 136/136
🟒 Lines 99.16% 473/477

Test suite run success

153 tests passing in 9 suites.

Report generated by πŸ§ͺjest coverage report action from 9a4a9edbcc5296f93b834b304ec643fa9e902f26