sclass ErrorCounter { 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)); } }