Skip to content
Snippets Groups Projects
Verified Commit d26941f2 authored by Anian Bühler's avatar Anian Bühler
Browse files

fixed try/catch errors when not in IDE

parent 2f9e3cc8
Branches
No related tags found
1 merge request!1dev_prefereences to master
......@@ -140,7 +140,7 @@ public class Context
try {
//TODO: set defaultFileName in ardublock.properties
loadPath = new File(URLDecoder.decode(getClass().getProtectionDomain().getCodeSource().getLocation().getFile(), "UTF-8")).getParentFile().getPath()+ File.separator +"defaultProgram.abp";
} catch (UnsupportedEncodingException e2) {
} catch (Exception e2) {
// TODO Auto-generated catch block
//e2.printStackTrace();
System.out.println("No default programm.");
......@@ -152,7 +152,7 @@ public class Context
workspaceController.loadProjectFromPath(loadPath, "default");
}
} catch (IOException e1) {
} catch (Exception e1) {
try {
InputStream is = getClass().getResourceAsStream(DEFAULT_ARDUBLOCK_PROGRAM_PATH);
InputStreamReader isr = new InputStreamReader(is);
......@@ -168,13 +168,20 @@ public class Context
isr.close();
is.close();
try {
if(PreferencesData.get("ardublock.workspace.mode").contains("custom") || PreferencesData.get("ardublock.workspace.mode").contains("page") || PreferencesData.get("ardublock.workspace.mode").contains("default") ) {
workspaceController.loadProject(defaultFileString, null , PreferencesData.get("ardublock.workspace.mode"));
} else {
workspaceController.loadProject(defaultFileString, null , "default");
}
} catch (Exception e) {
workspaceController.loadProject(defaultFileString, null , "default");
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e) {
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment