def messagebox_on_error(msg):

    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except Exception as e:
                m = "%s\n%s" % (msg, e.message)
                detail = str(traceback.format_exc())
                qmb = QMessageBox(QMessageBox.Critical, "Error", m)
                qmb.setDetailedText(detail)
                qmb.resize(400, qmb.size().height())
                qmb.exec_()
        return wrapper

    return decorator
%prog mito input.bam chrM chrM.fa
dataset/ETHPy150Open glue-viz/glue/glue/utils/qt/decorators.py/messagebox_on_error--crossover with--dataset/ETHPy150Open tanghaibao/jcvi/variation/delly.py/mito