...
An Error object is passed to the error property of the object that is passed to the afterUploadImage event when upload fails.
Example of removing failed
...
image when upload fails
| Code Block | ||
|---|---|---|
| ||
editor.setEventListener('afterUploadImage', function (e) {
if (e.error && e.error.status === 500) {
e.editor.execCommand('showDialog', 'alert', 'Image upload failed.');
var image = e.editor.getAPIModelById(e.elementId);
image.remove();
}
}); |
...