Skip to content

Instantly share code, notes, and snippets.

@elchele
Created June 18, 2019 23:06
Show Gist options
  • Save elchele/b87b7f422933ede747e235481ab7f074 to your computer and use it in GitHub Desktop.
Save elchele/b87b7f422933ede747e235481ab7f074 to your computer and use it in GitHub Desktop.
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