Skip to content

Commit 55edbe5

Browse files
author
jantje
committed
Better error handling
A bug in secure OTA was that the password from the secure storage was null and as such a null was put in a environment variable which makes the expansion crash (with a wierd error) This change only tells the expansion fails but gives no information as to which env far is the root cause.
1 parent 6851a2f commit 55edbe5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

io.sloeber.core/src/io/sloeber/core/tools/uploaders/arduinoUploader.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.eclipse.core.resources.IFile;
1414
import org.eclipse.core.resources.IProject;
1515
import org.eclipse.core.runtime.IProgressMonitor;
16+
import org.eclipse.core.runtime.IStatus;
17+
import org.eclipse.core.runtime.Status;
1618
import org.eclipse.ui.console.MessageConsole;
1719

1820
import io.sloeber.core.api.PasswordManager;
@@ -77,14 +79,15 @@ public boolean uploadUsingPreferences(IFile hexFile, boolean usingProgrammer, IP
7779
command = envManager
7880
.getVariable(Common.get_Jantje_KEY_RECIPE(Const.ACTION_UPLOAD), configurationDescription, true)
7981
.getValue();
80-
} catch (Exception e) {// ignore all errors
82+
} catch (Exception e) {
83+
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, "Failed to get the Upload recipe ", e)); //$NON-NLS-1$
84+
return false;
8185
}
8286

8387
try {
8488
GenericLocalUploader.RunConsoledCommand(this.myConsole, command, monitor);
8589
} catch (IOException e1) {
86-
e1.printStackTrace();
87-
90+
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, "Failed to run the Upload recipe ", e1)); //$NON-NLS-1$
8891
return false;
8992
}
9093
if (boardName.startsWith("Arduino Due ")) { //$NON-NLS-1$

0 commit comments

Comments
 (0)