I would like the _showErrorMessage popup to display the _actual_ error message, not "Something went wrong. Please try again." Especially because you know exactly went wrong. It's in the data sent via trigger:
editor.events.trigger('file.error', [{
code: code,
message: error_messages[code]
}, response]);
In my specific case, I would like it to say "File is too large." because it execes the maxFileSize
Only displays "Something went wrong. Please try again."
This is my workaround:
.on('froalaEditor.file.error', (e, editor, data) => {
if (data.message) {
editor.popups.areVisible()
.find('.fr-file-progress-bar-layer.fr-error .fr-message')
.text(data.message);
}
})
It can be done as described in the last comment. We don't plan to add this as default because there are also errors which might happen on the server side and showing those to users is not ok.
@stefanneculai okay, I know my workaround works, but is that what you would actually recommend doing; or do you have a better suggestion?
@jpgilchrist here is a similar solution I recommend some time ago: https://github.com/froala/wysiwyg-editor/issues/1358#issuecomment-228046725/
Fantastic ty
This has come up for us as well. We've gotten a lot of customers contacting us because the error message "Something went wrong" doesn't give them any way to resolve their own issue.
Finding a string in an existing modal and replacing it on the fly seems very hacky. I echo jpgilchrist's sentiments that if you have the error messages already in a hash, we're better off showing them.
Any one of these error messages would be fine to show a user compared to "Something went wrong":

In our case, we're just editing the plugin file to place the "Something went wrong" text with error_messages[code].
This means we have to make sure to always remember to replace it when we upgrade to the new versions, but it's working.
There should be a way of dynamically injecting these during initialization.
Most helpful comment
This has come up for us as well. We've gotten a lot of customers contacting us because the error message "Something went wrong" doesn't give them any way to resolve their own issue.
Finding a string in an existing modal and replacing it on the fly seems very hacky. I echo jpgilchrist's sentiments that if you have the error messages already in a hash, we're better off showing them.
Any one of these error messages would be fine to show a user compared to "Something went wrong":

In our case, we're just editing the plugin file to place the "Something went wrong" text with
error_messages[code].This means we have to make sure to always remember to replace it when we upgrade to the new versions, but it's working.