i am making a function which does something that may raise an exception. normally i would have the caller handle the exception. but i have cases where the function needs to handle the exception if the caller is not handling it. an example case is the function performing printing with the possibility of BrokenPipeError being raised. the caller may want to handle it and quickly exit when it happens. but, it is not handled by the caller, i want the function to handle the exception inside the function to avoid causing the script to be aborted (to allow the caller to finish in case it has critical steps it must do at the end). how can i make the function handle an exception and allow the caller handling of it take precedent?
the printing case is just one example.
the printing case is just one example.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.