sclass ErrorCounter { new LPair errors; void run(O info, Runnable r) { try { r.run(); } catch print e { errors.add(pair(info, e)); } } void print() { if (empty(errors)) _print("No errors"); else _print(n2(errors, "error") + " in " + pairsA(errors)); } }