using exceptions error code as an exit code

As requested