File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed
arduino-core/src/processing/app Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 11package processing .app ;
22
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 ;
105
11- import java .awt .* ;
6+ import java .awt .Font ;
127import java .io .File ;
138import java .io .IOException ;
149import java .io .PrintWriter ;
1813import java .util .MissingResourceException ;
1914import java .util .stream .Collectors ;
2015
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 ;
2223
2324
2425public class PreferencesData {
@@ -136,6 +137,9 @@ static protected void save() {
136137 }
137138
138139 writer .flush ();
140+ } catch (Throwable e ) {
141+ System .err .println (format (tr ("Could not write preferences file: {0}" ), e .getMessage ()));
142+ return ;
139143 } finally {
140144 IOUtils .closeQuietly (writer );
141145 }
Original file line number Diff line number Diff line change @@ -566,12 +566,9 @@ static public PrintWriter createWriter(File file) {
566566 if (file == null ) {
567567 throw new RuntimeException ("File passed to createWriter() was null" );
568568 } 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 );
572570 }
573571 }
574- //return null;
575572 }
576573
577574
You can’t perform that action at this time.
0 commit comments