javascript: human-readable message for reading errors during upload
This commit is contained in:
parent
487b7a8c8c
commit
4b288038d3
1 changed files with 10 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
||||||
import Uploader from '../../shared/activestorage/uploader';
|
import Uploader from '../../shared/activestorage/uploader';
|
||||||
import { show, hide, toggle } from '@utils';
|
import { show, hide, toggle } from '@utils';
|
||||||
import { FAILURE_CONNECTIVITY } from '../../shared/activestorage/file-upload-error';
|
import {
|
||||||
|
ERROR_CODE_READ,
|
||||||
|
FAILURE_CONNECTIVITY
|
||||||
|
} from '../../shared/activestorage/file-upload-error';
|
||||||
|
|
||||||
// Given a file input in a champ with a selected file, upload a file,
|
// Given a file input in a champ with a selected file, upload a file,
|
||||||
// then attach it to the dossier.
|
// then attach it to the dossier.
|
||||||
|
@ -68,6 +71,12 @@ export default class AutoUploadController {
|
||||||
description: 'Vérifiez votre connexion à Internet, puis ré-essayez.',
|
description: 'Vérifiez votre connexion à Internet, puis ré-essayez.',
|
||||||
retry: true
|
retry: true
|
||||||
};
|
};
|
||||||
|
} else if (error.code == ERROR_CODE_READ) {
|
||||||
|
return {
|
||||||
|
title: 'Nous n’arrivons pas à lire ce fichier sur votre appareil.',
|
||||||
|
description: 'Essayez à nouveau, ou sélectionnez un autre fichier.',
|
||||||
|
retry: false
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
title: 'Le fichier n’a pas pu être envoyé.',
|
title: 'Le fichier n’a pas pu être envoyé.',
|
||||||
|
|
Loading…
Add table
Reference in a new issue