File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/lib/components/projects Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1717 cancel ()
1818
1919 const workflowFile = data .get (' workflowFile' )
20- console .log (workflowFile)
2120
2221 if (workflowFile .name == ' ' ) {
2322 throw new Error (' No workflow file specified' )
2423 }
2524
26- const workflowMetadata = await workflowFile .text ().then (data => JSON .parse (data))
27- console .log (workflowMetadata)
25+ const workflowMetadata = await workflowFile .text ()
26+ .then (data => JSON .parse (data))
27+ .catch (() => {
28+ throw new Error (' The format of the selected file is not valid. Please select a valid workflow file.' )
29+ })
2830
2931 // Request workflow import
3032 importing = true
5860
5961 <div class =" mb-3" >
6062 <label for =" workflowFile" class =" form-label" >Select a workflow file</label >
61- <input class =" form-control" type =" file" name =" workflowFile" id =" workflowFile" >
63+ <input class =" form-control" accept = " application/json " type =" file" name =" workflowFile" id =" workflowFile" >
6264 </div >
6365
6466 <button class ="btn btn-primary" disabled ={importing }>
You can’t perform that action at this time.
0 commit comments