creativecommons / legaldb

CC Legal Database: curated repository of Case Law and Scholarship data from around the world in a Django based website.
https://LegalDB.CreativeCommons.org/
MIT License
46 stars 69 forks source link

[Bug] Error Handling for patchAssetIntoDom Function in base.html #212

Open wendy640 opened 1 month ago

wendy640 commented 1 month ago

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

  1. Call the patchAssetIntoDom function with an invalid asset path or an unreachable URL.
  2. Observe that no error message is displayed in the console.
  3. Check if any subsequent code that relies on the loaded asset fails silently.

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

TimidRobot commented 1 month ago

https://github.com/creativecommons/legaldb/labels/%F0%9F%9A%A7%20status%3A%20blocked as I expect this issue will be resolved by migrating this project to the current Vocabulary design system: