fix #562: fail on empty code and handle analyze exceptions