Custom error message for jQuery plugin

Archived from the Transloadit support forum. Originally posted on June 2, 2011; details may be outdated, see our docs for current behavior. Original thread

Hi, is there a way to customize MAX_SIZE error message “MAX_SIZE_EXCEEDED: the uploaded file exceeded the file size limit”? I would like to display something less technical.

I figured this one out:

onError: function(assembly) {
        if (assembly.error=='MAX_SIZE_EXCEEDED') {
            $('.error').replaceWith('<p class="error">MY CUSTOM MESSAGE</p>');
        }
    }

Yes, that’s the way to go. Closing this ticket for now.