openverse-frontend
openverse-frontend copied to clipboard
Fix media fetching error handling to actually capture issue description
Sentry link
https://sentry.io/share/issue/0e9ffd2ec1144d8e8b504db32e4e6c25/
Description
https://github.com/WordPress/openverse-frontend/blob/96b061f411fbc73ae55980e2b6f9ecd358931762/src/stores/media/index.ts#L388
If we don't know how to handle an error, we should not just swallow it completely and mask it with a vague string unless we're also capturing the error in Sentry. Update the above code to call this.$sentry.captureException(error) in the case where we don't know how to correctly handle the error. Do this with the original exception, not with the vague/useless for debugging error message we set here.
Marking as high because this prevents us from debugging actual issues in this part of the code.
While we're at it, it's probably not a bad idea to audit our error handling across the app and create subsequent issues to better capture exceptions and not swallow error messages when we don't know how to handle errors.
I would be interested in resolving this bug.
Closed by #1707. Thanks @ramadanomar