I agree with @josenavas: within library code, errors need to be raised (with informative error messages, of course), instead of printing a message and exiting.