Skip to content

Commit 7e65e5b

Browse files
samuel-rlball-hayden
authored andcommitted
fix: throw exception on zip error
1 parent 7bc0a52 commit 7e65e5b

File tree

1 file changed

+5
-2
lines changed
  • react-native-mcu-manager/android/src/main/java/uk/co/playerdata/reactnativemcumanager

1 file changed

+5
-2
lines changed

react-native-mcu-manager/android/src/main/java/uk/co/playerdata/reactnativemcumanager/DeviceUpgrade.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ class DeviceUpgrade(
9898
dfuManager.setMode(upgradeMode)
9999
dfuManager.start(images, settings)
100100
} catch (e1: Exception) {
101-
return
101+
e1.printStackTrace()
102+
disconnectDevice()
103+
withSafePromise { promise ->
104+
promise.reject(ReactNativeMcuMgrException.fromMcuMgrException(e1))
105+
}
102106
}
103107
}
104108
} catch (e: IOException) {
@@ -108,7 +112,6 @@ class DeviceUpgrade(
108112
} catch (e: McuMgrException) {
109113
e.printStackTrace()
110114
disconnectDevice()
111-
Log.v(this.TAG, "mcu exception")
112115
withSafePromise { promise ->
113116
promise.reject(ReactNativeMcuMgrException.fromMcuMgrException(e))
114117
}

0 commit comments

Comments
 (0)