Catch possible exceptions in PseudoParser.scan_directory