exit with an error code when there's an error