Exception clause for detecting editable packages will silently catch all exceptions
The code that identifies packages installed in editable/dev mode currently catches all exceptions, and continues on with an empty set for dev/editable packages if it encounters and error. While this is not a crucial enhancement, it might be worth exploring potential issues that we should handle.
[nitpick] The broad exception clause except (json.JSONDecodeError, Exception): will silently catch all exceptions, including unexpected errors like TypeError, AttributeError, or KeyError that might indicate bugs. This makes debugging difficult.
Consider being more specific about which exceptions to catch, or at least log the exception:
except json.JSONDecodeError as e:
self.log.warning(f"Failed to parse pip editable packages JSON: {e}")
except Exception as e:
self.log.warning(f"Failed to get pip editable packages: {e}")
except json.JSONDecodeError as e:
self.log.warning(f"Failed to parse pip editable packages JSON: {e}")
except Exception as e:
self.log.warning(f"Failed to get pip editable packages: {e}")
Originally posted by @Copilot in https://github.com/mamba-org/gator/pull/352#discussion_r2601431671