let application exit with code 1 on error/exception in console

fixes #2233