In case of an error or IOException exit with exit code 1