File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ $(document).ready(function () {
483483
484484 // Open a ScanCode results JSON file
485485 ipcRenderer . on ( 'import-JSON' , function ( ) {
486- dialog . showOpenDialog ( {
486+ dialog . showOpenDialog ( {
487487 title : "Open a JSON File" ,
488488 filters : [ {
489489 name : 'JSON File' ,
@@ -574,6 +574,16 @@ $(document).ready(function () {
574574 alert ( `Error: ${ err . message ? err . message : err } ` ) ;
575575 } ) ;
576576 } ) ;
577+ } ) . fail ( function ( jqxhr , textStatus , error ) {
578+ // Show error for problem with the JSON file
579+ dialog . showErrorBox (
580+ "JSON Error" ,
581+ "There is a problem with your JSON file. It may be malformed " +
582+ "(e.g., the addition of a trailing comma), " +
583+ "or there could be some other problem with the file. " +
584+ "\n\nPlease check your file and try again. " +
585+ "\n\nThe error thrown by the system is: \n\n" + error
586+ ) ;
577587 } ) ;
578588 } ) ;
579589 } ) ;
You can’t perform that action at this time.
0 commit comments