Skip to content

Commit fc10ae7

Browse files
committed
Exception handling improved
1 parent 77e18a9 commit fc10ae7

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

TODOS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Documentation:
5353
#4
5454
Dont to use logging.error or logging.warning as it has no effect if used in combination with multiprocessing.
5555

56-
1917141915:AAHRe-CZhv8fIv6bQzHMipgYPuVnQbQGxtY
5756

5857
CCXT Method: Try to optimize large if-else areas for parsing config
5958

src/Pythonic/element_types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ def execute_ex(self):
3131
try:
3232
result = self.execute()
3333
except Exception as e:
34-
guiexc = GuiException()
34+
guiexc = GuiException(e)
3535
self.return_queue.put(guiexc)
36-
self.logger.error(repr(e))
37-
# signalize exception on GUI
3836

3937

4038
class Record():
@@ -74,7 +72,9 @@ def __getstate__(self):
7472
return(self.text)
7573

7674
class GuiException:
77-
pass
75+
76+
def __init__(self, e : Exception) -> None:
77+
self.e = e
7878

7979
class ProcCMD:
8080

src/Pythonic/execution_operator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ def operationDone(self, id, area, record, identifier):
534534
'cmd' : 'ElementException',
535535
'address' : address
536536
}
537+
# log critical exceptions from multiprocessed elements
538+
logging.error(repr(record.e))
537539
self.command.emit(cmd)
538540
return
539541

src/Pythonic/web_daemon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def __init__(self, app):
411411

412412
parser = argparse.ArgumentParser(description='Pythonic background daemon')
413413
# Debug output switch
414-
parser.add_argument('-Ex', action='store_true', help='Interactive shell intercace, Unix only')
414+
parser.add_argument('-Ex', action='store_true', help='Interactive shell interface, Unix only')
415415
# Log level
416416
parser.add_argument('-v', action='store_true', help='Verbose output')
417417

0 commit comments

Comments
 (0)