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.
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().
scripts/src/owners/owners_file.py could be reworked to either:
status
return value inget_owner_data_from_file
but using custom Exceptions instead.Exceptions
in the code. This could be done by catchingKeyError
(potentially usingsupress
context manager when nothing is done when catching the Exception) or by usingget()
.