aboutsummaryrefslogtreecommitdiff
path: root/modules/errors.py
blob: 372dc51a0b95eca18d2474d333509b92eacbe92e (plain)
1
2
3
4
5
6
7
8
9
10
import sys
import traceback


def run(code, task):
    try:
        code()
    except Exception as e:
        print(f"{task}: {type(e).__name__}", file=sys.stderr)
        print(traceback.format_exc(), file=sys.stderr)