The patchAssetIntoDom function currently lacks error handling for network issues and HTTP response errors. This can lead to silent failures, negatively impacting user experience and making debugging difficult.
Reproduction
Call the patchAssetIntoDom function with an invalid asset path or an unreachable URL.
Observe that no error message is displayed in the console.
Check if any subsequent code that relies on the loaded asset fails silently.
I expected to see error messages in the console if the asset fails to load, either due to a network issue or an HTTP error status. This would help identify problems more quickly and improve the overall reliability of the application.
Environment
Device: (eg. iPhone Xs; laptop)
OS: (eg. iOS 13.5; Fedora 32)
Browser: (eg. Safari; Firefox)
Version: (eg. 13; 73)
Other info: (eg. display resolution, ease-of-access settings)
Description
The
patchAssetIntoDom
function currently lacks error handling for network issues and HTTP response errors. This can lead to silent failures, negatively impacting user experience and making debugging difficult.Reproduction
patchAssetIntoDom
function with an invalid asset path or an unreachable URL.Note code: https://github.com/creativecommons/legaldb/blob/83e0303b56e2a97b6fefd627bb049b9dd380b028/legal_db/templates/legal_db/base.html#L29-L42
Expectation
I expected to see error messages in the console if the asset fails to load, either due to a network issue or an HTTP error status. This would help identify problems more quickly and improve the overall reliability of the application.
Environment
Additional context
Resolution