mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Better error handling
This commit is contained in:
@ -109,7 +109,11 @@ def main():
|
||||
An unexpected error occurred. Further steps:
|
||||
|
||||
* Verify that you have the latest version of PlatformIO using
|
||||
`platformio upgrade` command
|
||||
`pip install -U platformio` command
|
||||
|
||||
* Try to find answer in FAQ Troubleshooting section
|
||||
http://docs.platformio.org/en/latest/faq.html
|
||||
|
||||
* Report this problem to the developers
|
||||
https://github.com/platformio/platformio/issues
|
||||
|
||||
|
@ -22,6 +22,7 @@ import uuid
|
||||
from collections import deque
|
||||
from os import getenv
|
||||
from time import sleep, time
|
||||
from traceback import format_exc
|
||||
|
||||
import click
|
||||
import requests
|
||||
@ -289,12 +290,13 @@ def on_event(category, action, label=None, value=None, screen_name=None):
|
||||
def on_exception(e):
|
||||
if isinstance(e, exception.AbortedByUser):
|
||||
return
|
||||
mp = MeasurementProtocol()
|
||||
mp['exd'] = "%s: %s" % (type(e).__name__, e)
|
||||
mp['exf'] = int(any([
|
||||
is_crash = any([
|
||||
not isinstance(e, exception.PlatformioException),
|
||||
"Error" in e.__class__.__name__
|
||||
]))
|
||||
])
|
||||
mp = MeasurementProtocol()
|
||||
mp['exd'] = "%s: %s" % (type(e).__name__, format_exc() if is_crash else e)
|
||||
mp['exf'] = 1 if is_crash else 0
|
||||
mp.send("exception")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user