File tree 2 files changed +14
-13
lines changed
arduino-core/src/processing/app
2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 1
1
package processing .app ;
2
2
3
- import org .apache .commons .compress .utils .IOUtils ;
4
-
5
- import cc .arduino .i18n .Languages ;
6
- import processing .app .helpers .PreferencesHelper ;
7
- import processing .app .helpers .PreferencesMap ;
8
- import processing .app .legacy .PApplet ;
9
- import processing .app .legacy .PConstants ;
3
+ import static processing .app .I18n .format ;
4
+ import static processing .app .I18n .tr ;
10
5
11
- import java .awt .* ;
6
+ import java .awt .Font ;
12
7
import java .io .File ;
13
8
import java .io .IOException ;
14
9
import java .io .PrintWriter ;
18
13
import java .util .MissingResourceException ;
19
14
import java .util .stream .Collectors ;
20
15
21
- import static processing .app .I18n .tr ;
16
+ import org .apache .commons .compress .utils .IOUtils ;
17
+
18
+ import cc .arduino .i18n .Languages ;
19
+ import processing .app .helpers .PreferencesHelper ;
20
+ import processing .app .helpers .PreferencesMap ;
21
+ import processing .app .legacy .PApplet ;
22
+ import processing .app .legacy .PConstants ;
22
23
23
24
24
25
public class PreferencesData {
@@ -136,6 +137,9 @@ static protected void save() {
136
137
}
137
138
138
139
writer .flush ();
140
+ } catch (Throwable e ) {
141
+ System .err .println (format (tr ("Could not write preferences file: {0}" ), e .getMessage ()));
142
+ return ;
139
143
} finally {
140
144
IOUtils .closeQuietly (writer );
141
145
}
Original file line number Diff line number Diff line change @@ -566,12 +566,9 @@ static public PrintWriter createWriter(File file) {
566
566
if (file == null ) {
567
567
throw new RuntimeException ("File passed to createWriter() was null" );
568
568
} else {
569
- e .printStackTrace ();
570
- throw new RuntimeException ("Couldn't create a writer for " +
571
- file .getAbsolutePath ());
569
+ throw new RuntimeException ("Couldn't create a writer for " + file .getAbsolutePath (), e );
572
570
}
573
571
}
574
- //return null;
575
572
}
576
573
577
574
You can’t perform that action at this time.
0 commit comments