I want to catch an exception (or something else) when my program is killed by a kill
command from the operating system.
I want to print a message to a log file before closing.
Is there a way to do it?
Thanks
I want to catch an exception (or something else) when my program is killed by a kill
command from the operating system.
I want to print a message to a log file before closing.
Is there a way to do it?
Thanks
Try adding a shutdown hook