mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Better error handling
This commit is contained in:
@ -109,7 +109,11 @@ def main():
|
|||||||
An unexpected error occurred. Further steps:
|
An unexpected error occurred. Further steps:
|
||||||
|
|
||||||
* Verify that you have the latest version of PlatformIO using
|
* 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
|
* Report this problem to the developers
|
||||||
https://github.com/platformio/platformio/issues
|
https://github.com/platformio/platformio/issues
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import uuid
|
|||||||
from collections import deque
|
from collections import deque
|
||||||
from os import getenv
|
from os import getenv
|
||||||
from time import sleep, time
|
from time import sleep, time
|
||||||
|
from traceback import format_exc
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import requests
|
import requests
|
||||||
@ -289,12 +290,13 @@ def on_event(category, action, label=None, value=None, screen_name=None):
|
|||||||
def on_exception(e):
|
def on_exception(e):
|
||||||
if isinstance(e, exception.AbortedByUser):
|
if isinstance(e, exception.AbortedByUser):
|
||||||
return
|
return
|
||||||
mp = MeasurementProtocol()
|
is_crash = any([
|
||||||
mp['exd'] = "%s: %s" % (type(e).__name__, e)
|
|
||||||
mp['exf'] = int(any([
|
|
||||||
not isinstance(e, exception.PlatformioException),
|
not isinstance(e, exception.PlatformioException),
|
||||||
"Error" in e.__class__.__name__
|
"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")
|
mp.send("exception")
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user