You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Removed some catching of exceptions inside the workflow
to catch at outer function so we can report.
- Added an element to the dialog to hold status messages.
- Catch and analyze exceptions to print user friendly
messages if possible.
console.log("Modal not active on _setStatus()",e);
399
+
}
400
+
}
401
+
402
+
// Analyzes the error returned from the WebSerial API and returns human readable feedback.
403
+
_suggestSerialConnectActions(error){
404
+
if(error.name=="NetworkError"&&error.message.includes("Failed to open serial port")){
405
+
return"The serial port could not be opened. Make sure the correct port is selected and no other program is using it. For more information, see the JavaScript console.";
406
+
}elseif(error.name=="NotFoundError"&&error.message.includes("No port selected")){
407
+
return"No serial port was selected. Press the 'Connect to Device' button to try again.";
408
+
}elseif(error.name=="SecurityError"){
409
+
return"Permissions to access the serial port were not granted. Please check your browser settings and try again.";
410
+
}
411
+
return`Connect to Serial Port returned error: ${error}`;
412
+
}
413
+
414
+
// Analyzes the error from the FSAPI and returns human readable feedback
415
+
_suggestFileConnectActions(error){
416
+
if(error.name=="SecurityError"){
417
+
return"Permissions to access the filesystem were not granted. Please check your browser settings and try again.";
418
+
}elseif(error.name=="AbortError"){
419
+
return"No folder selected. Press the 'Select New Folder' button to try again.";
420
+
}
421
+
return`Connect to Filesystem returned error: ${error}`;
0 commit comments