I need to catch that exception but I can’t figure out which one it is. The IDE i’m using right now doesn’t allow for a program interrupt that way.
I know how to user try/catch, but I don’t actually know what I’m trying to catch..
Can anyone help me with this?
I seem to recall that CTRL-C becomes an InterruptedException and this article seems to support that. As suggested in other answers the use of
addShutdownHookis a good way to go, unless you want to prevent the shutdown.