Skip to content

Commit

Permalink
minor changes to exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mpr1c3 authored and dl1com committed Aug 27, 2023
1 parent 80b108d commit c7353df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/python/ayab/engine/communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def open_serial(self, portname=None):
self.__ser = serial.Serial(self.__portname,
115200,
timeout=0.1)
except:
except Exception:
self.logger.error("could not open serial port " +
self.__portname)
raise CommunicationException()
Expand All @@ -102,7 +102,7 @@ def close_serial(self):
del (self.__ser)
self.__ser = None
self.logger.info("Closing serial port successful.")
except:
except Exception:
self.logger.warning("Closing serial port failed. \
Was it ever open?")

Expand Down
4 changes: 2 additions & 2 deletions src/main/python/ayab/firmware_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def execute_flash_command(self):
try:
p = check_output(command, stderr=STDOUT, timeout=10, shell=True)
except Exception as e:
self.__logger.info("Error flashing firmware: " + str(e))
self.__logger.info("Error flashing firmware: " + repr(e))
utils.display_blocking_popup(
tr_("Firmware", "Error flashing firmware."), "error")
return False
Expand All @@ -172,7 +172,7 @@ def generate_command(self, base_dir, os_name, controller_name,
# run subprocess
result = run(["which", "avrdude"], stdout=PIPE, stderr=PIPE)
print(result)
except:
except Exception:
self.__logger.error("`avrdude` not found in path")
utils.display_blocking_popup(
QCoreApplication.translate(
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/ayab/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def apply_transform(self, transform, *args):
self.image = transform(self.image, args)
try:
pass #self.image = transform(self.image, args)
except:
logging.error("Error while executing image transform.")
except Exception as e:
logging.error("Error while executing image transform: " + repr(e))

# Update the view
self.emit_image_resizer()
Expand Down

0 comments on commit c7353df

Please sign in to comment.