File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -806,9 +806,17 @@ firmware_flasher.initialize = async function (callback) {
806806 // Maybe the board is in DFU mode, but it does not have permissions. Ask for them.
807807 console . log ( `${ self . logHead } No valid port detected, asking for permissions` ) ;
808808
809- DFU . requestPermission ( ) . then ( ( device ) => {
810- DFU . connect ( device . path , firmware , options ) ;
811- } ) ;
809+ DFU . requestPermission ( )
810+ . then ( ( device ) => {
811+ DFU . connect ( device . path , firmware , options ) ;
812+ } )
813+ . catch ( ( error ) => {
814+ console . error ( "Permission request denied" , error ) ;
815+ self . flashingMessage (
816+ i18n . getMessage ( "firmwareFlasherNoDevice" ) ,
817+ self . FLASH_MESSAGE_TYPES . INVALID ,
818+ ) ;
819+ } ) ;
812820 }
813821
814822 GUI . interval_resume ( "sponsor" ) ;
You can’t perform that action at this time.
0 commit comments