Skip to content

Instantly share code, notes, and snippets.

@elchele
Created Jun 18, 2019
Embed
What would you like to do?
Debugging file upload issues
({
/* File: ./custom/clients/base/fields/file/file.js */
extendsFrom: 'FileField',
_doValidateFileError: function(fields, errors, callback, resp) {
app.alert.dismiss('upload');
app.logger.fatal(resp);
var errors = errors || {},
fieldName = this.name;
errors[fieldName] = {};
switch (resp.error) {
case 'request_too_large':
errors[fieldName].tooBig = true;
break;
default:
errors[fieldName].uploadFailed = true;
}
this.model.unset(fieldName + '_guid');
callback(null, fields, errors);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment