What is the best way to catch error details on production devices?
I'm using a try/catch on the outer most part of my code and then recording the exception to a file using logger. This works ok but it doesn't tell me where the error occurs, file/line number so it can be tricky to debug sometimes Is there a way to catch the full traceback?
Thanks
Code: Select all
try:
main_prog()
except Exception as e:
logger.error(str(e))
logger.error("Resetting microcontroller")
time.sleep(5)
machine.reset()