sydevs / WeMeditate

International website promoting the practice of meditation, with online resources and free local classes.
https://www.wemeditate.com
5 stars 6 forks source link

Error handling for failed image uploads in editor #78

Open dbackeus opened 3 years ago

dbackeus commented 3 years ago

When uploading an invalid image file in the editor the error isn't handled in the frontend so what ends up happening is that a broken image is inserted into the editor.

To reproduce: Take any non-image file and rename the extension to .jpg and upload it as an image.

Likely the code-entrypoint that needs to be improved is here where we currently just log the error but take not further action: https://github.com/sydevs/WeMeditate/blob/9eb86afa0f085b08c35ae8bfe09ce3f31e7032e8/app/assets/javascripts/admin/cdx-editor/image-uploader.js#L83-L85