You're trying to parse numbers even if exit is called causing the exception to be thrown before exiting can occur. A problem is that your Handler class is trying to do too much, trying to handle...