openshift-helm-charts / development

0 stars 17 forks source link

Raise custom Exception in owners_file.py #317

Closed mgoerens closed 4 months ago

mgoerens commented 6 months ago

scripts/src/owners/owners_file.py could be reworked to either:

  1. Raise custom Exceptions whenever some data cannot be found in the OWNERS file. This requires also the caller functions to be modified to handle those Custom Exceptions. This is similar to the status return value in get_owner_data_from_file but using custom Exceptions instead.
  2. Keep returning empty strings, but at least stop catching broad Exceptions in the code. This could be done by catching KeyError (potentially using supress context manager when nothing is done when catching the Exception) or by using get().