mirror of
https://github.com/esphome/esp-web-tools.git
synced 2025-07-27 21:56:35 +00:00
Always throw error when init fails (#244)
This commit is contained in:
parent
63e097eb78
commit
5ac98c6193
12
src/flash.ts
12
src/flash.ts
@ -48,13 +48,13 @@ export const flash = async (
|
||||
await esploader.initialize();
|
||||
} catch (err: any) {
|
||||
logger.error(err);
|
||||
fireStateEvent({
|
||||
state: FlashStateType.ERROR,
|
||||
message:
|
||||
"Failed to initialize. Try resetting your device or holding the BOOT button while clicking INSTALL.",
|
||||
details: { error: FlashError.FAILED_INITIALIZING, details: err },
|
||||
});
|
||||
if (esploader.connected) {
|
||||
fireStateEvent({
|
||||
state: FlashStateType.ERROR,
|
||||
message:
|
||||
"Failed to initialize. Try resetting your device or holding the BOOT button while clicking INSTALL.",
|
||||
details: { error: FlashError.FAILED_INITIALIZING, details: err },
|
||||
});
|
||||
await esploader.disconnect();
|
||||
}
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user