Log full traceback on interpreter crash
The error handler only captured str(e), losing the stack trace. Now logs the full traceback so crashes are actually debuggable.
This commit is contained in:
parent
3627ce8245
commit
1ee89e5e3c
1 changed files with 3 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import asyncio
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
import traceback
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
|
@ -118,7 +119,8 @@ class EmbeddedIFSession:
|
||||||
except ZCpuRestart:
|
except ZCpuRestart:
|
||||||
logger.debug("Interpreter restart requested")
|
logger.debug("Interpreter restart requested")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Interpreter crashed: {e}")
|
tb = traceback.format_exc()
|
||||||
|
logger.error(f"Interpreter crashed:\n{tb}")
|
||||||
self._error = f"interpreter error: {e}"
|
self._error = f"interpreter error: {e}"
|
||||||
finally:
|
finally:
|
||||||
self._done = True
|
self._done = True
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue