def on_exception(e):
    if isinstance(e, exception.AbortedByUser):
        return
    is_crash = any([
        not isinstance(e, exception.PlatformioException),
        "Error" in e.__class__.__name__
    ])
    mp = MeasurementProtocol()
    mp['exd'] = (type(e).__name__, format_exc() if is_crash else e) % "%s: %s"
    mp['exf'] = 1 if is_crash else 0
    mp.send("exception")
dataset/ETHPy150Open platformio/platformio/platformio/telemetry.py/on_exception/swapped operands of `%`