File tree Expand file tree Collapse file tree 2 files changed +176
-102
lines changed
apps/web/src/features/upload Expand file tree Collapse file tree 2 files changed +176
-102
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,29 @@ export const UploadPage = () => {
2727 const { t } = useTranslation ( ) ;
2828
2929 const handleTemplateDownload = ( ) => {
30- const { content, fileName } = createUploadTemplateCSV ( instrument ! ) ;
31- void download ( fileName , content ) ;
30+ try {
31+ const { content, fileName } = createUploadTemplateCSV ( instrument ! ) ;
32+ void download ( fileName , content ) ;
33+ } catch ( error ) {
34+ if ( error instanceof Error ) {
35+ addNotification ( {
36+ message : t ( {
37+ en : `Error occurred downloading sample template with the following message: ${ error . message } ` ,
38+ fr : `Un occurence d'un erreur quand le csv document est telecharger avec la message suivant: ${ error . message } `
39+ } ) ,
40+ type : 'error'
41+ } ) ;
42+ } else {
43+ addNotification ( {
44+ message : t ( {
45+ en : `Error occurred downloading sample template.` ,
46+ fr : `Un occurence d'un erreur quand le csv est telecharger. `
47+ } ) ,
48+ type : 'error'
49+ } ) ;
50+ }
51+ console . error ( error ) ;
52+ }
3253 } ;
3354
3455 const handleInstrumentCSV = async ( ) => {
You can’t perform that action at this time.
0 commit comments