Add some debug logging, fix error message
parent
51b8df2eb2
commit
3c8bb3fc01
|
@ -51,15 +51,27 @@ uploadAreas.forEach(uploadArea => {
|
||||||
});
|
});
|
||||||
uppy.use(StatusBar, {
|
uppy.use(StatusBar, {
|
||||||
target: statusArea,
|
target: statusArea,
|
||||||
|
showProgressDetails: true,
|
||||||
});
|
});
|
||||||
uppy.use(AwsS3Multipart, {
|
uppy.use(AwsS3Multipart, {
|
||||||
limit: 3,
|
limit: 3,
|
||||||
companionUrl: window.location.pathname,
|
companionUrl: window.location.pathname,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
uppy.on('file-added', (f, progress) => {
|
||||||
|
console.debug(`${f.id}: Waiting...`)
|
||||||
|
});
|
||||||
|
uppy.on('upload-progress', (f, progress) => {
|
||||||
|
if (!progress.uploadComplete) {
|
||||||
|
console.debug(`${f.id}: Uploading: ${progress.percentage}%`)
|
||||||
|
} else {
|
||||||
|
console.debug(`${f.id}: Processing...`);
|
||||||
|
}
|
||||||
|
});
|
||||||
uppy.on('upload-error', (f, error, res) => {
|
uppy.on('upload-error', (f, error, res) => {
|
||||||
|
console.debug(`${f.id}: Error: ${error}`);
|
||||||
window.e = { f, error, res };
|
window.e = { f, error, res };
|
||||||
if (error.message.contains('status: 409')) {
|
if (error.message?.includes('status: 409')) {
|
||||||
showError('A file with the same name already exists. Rename your file and try again');
|
showError('A file with the same name already exists. Rename your file and try again');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue