Skip to content

Commit fccfca8

Browse files
author
Federico Fissore
committed
Library: converted nulls to checked exceptions, removed printStackTrace, added "dependencies" member
1 parent 83bea65 commit fccfca8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/src/processing/app/Base.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,14 +1132,14 @@ public void rebuildExamplesMenu(JMenu menu) {
11321132
}
11331133
}
11341134

1135-
public LibraryList scanLibraries(List<File> folders) {
1135+
public LibraryList scanLibraries(List<File> folders) throws IOException {
11361136
LibraryList res = new LibraryList();
11371137
for (File folder : folders)
11381138
res.addOrReplaceAll(scanLibraries(folder));
11391139
return res;
11401140
}
11411141

1142-
public LibraryList scanLibraries(File folder) {
1142+
public LibraryList scanLibraries(File folder) throws IOException {
11431143
LibraryList res = new LibraryList();
11441144

11451145
String list[] = folder.list(new OnlyDirs());
@@ -1184,7 +1184,11 @@ public void onBoardOrPortChange() {
11841184
// Scan for libraries in each library folder.
11851185
// Libraries located in the latest folders on the list can override
11861186
// other libraries with the same name.
1187-
libraries = scanLibraries(librariesFolders);
1187+
try {
1188+
libraries = scanLibraries(librariesFolders);
1189+
} catch (IOException e) {
1190+
showWarning(_("Error"), _("Error reading preferences"), e);
1191+
}
11881192
String currentArch = Base.getTargetPlatform().getName();
11891193
libraries = libraries.filterByArchitecture(currentArch);
11901194

0 commit comments

Comments
 (0)