Skip to content

Commit

Permalink
[enh] Better traceback when in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Kastakin committed Aug 3, 2023
1 parent 66ec54a commit b980e12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/python/pyes/workers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import os
import time
import traceback
from datetime import datetime
from pathlib import Path

Expand Down Expand Up @@ -55,7 +56,12 @@ def run(self):
try:
optimizer.fit(self.data)
except Exception as e:
self.signals.aborted.emit(str(e))
if self.debug:
self.signals.aborted.emit(
"".join(traceback.TracebackException.from_exception(e).format())
)
else:
self.signals.aborted.emit(str(e))
return None

self.signals.log.emit(r"DATA LOADED!")
Expand Down

0 comments on commit b980e12

Please sign in to comment.