Closed marksabbath closed 7 years ago
Since this is a library I don't think that the code should call print()
, that is something the calling program should handle. I think the best way to handle this is to raise a custom exception that the input file is invalid so the calling program can decide what to do with the file.
Calling exit
in a library is a whole other level of things not to do. We shouldn't kill the main program on a parsing error.
Maybe instead of wrapping a simple key lookup in a try..except block we can use an if block to check if the property exists before using it.
Totally agree @MartijnBraam I'm gonna close this one and build a new branch from scratch following your suggestion.
Raise a properly exception when no binding property is available in dhcp.leases file.