Error handle filetree generation
This commit is contained in:
parent
581bb0ad3b
commit
505f6872f2
@ -20,6 +20,7 @@ import app.events.OpenFileEvent;
|
||||
import app.events.OpenProjectEvent;
|
||||
import app.events.SaveFileEvent;
|
||||
import app.model.Model;
|
||||
import app.service.DialogBoxes;
|
||||
import app.service.FiletreeOperations;
|
||||
import javafx.fxml.Initializable;
|
||||
|
||||
@ -56,9 +57,17 @@ public class FiletreeController implements Initializable, Controller {
|
||||
filetree.setShowRoot(false);
|
||||
File fileInputChosen = new File(inputChosen);
|
||||
|
||||
try {
|
||||
FiletreeOperations.generateTree(fileInputChosen, root);
|
||||
|
||||
filetree.setRoot(root);
|
||||
} catch (Exception e) {
|
||||
Model.setProjectPath(Optional.empty());
|
||||
DialogBoxes.showErrorMessage(
|
||||
"Could not open folder.\n\n"
|
||||
+ "Do you have the right permissions for this folder?\n"
|
||||
+ "Or does the folder contain any shortcut to somewhere within itself?");
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
@ -51,8 +51,7 @@ public class FileOperations {
|
||||
return true;
|
||||
|
||||
} catch (FileNotFoundException ex) {
|
||||
DialogBoxes.showErrorMessage("Could not save file!");
|
||||
System.err.println(filepath);
|
||||
DialogBoxes.showErrorMessage("Could not save file at \n" + filepath.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user