Skip to content

Commit

Permalink
try to add some exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
yaxu committed Jan 26, 2022
1 parent 1eac65f commit dc41ebc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions py-vortex/py_vortex/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, dsl_module):

# Define the geometry of the main window
# self.setGeometry(400, 100, 800, 600)
self.setFixedSize(1024, 768)
self.setFixedSize(1280, 800)
self.setWindowTitle(f"Vortex {__version__}")

# Create frame and layout
Expand Down Expand Up @@ -135,9 +135,9 @@ def evaluate_block(self):
_logger.info(f"Eval: '{code}'")
try:
exec(code, vars(self._dsl_module))
except Exception as err:
print("Error:", err)
# self.highlight_block(start, end)
except (TypeError, AttributeError) as e:
_logger.info("error: %s", str(e))
#self.highlight_block(start, end)

def get_current_block(self):
text = self._editor.text()
Expand Down
7 changes: 5 additions & 2 deletions py-vortex/py_vortex/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ def _notify_thread_target(self):
cycle_from = s.beatAtTime(logical_now, 0) / bpc
cycle_to = s.beatAtTime(logical_next, 0) / bpc

for sub in self._subscribers:
sub.notify_tick((cycle_from, cycle_to), s, cps, bpc, mill, now)
try:
for sub in self._subscribers:
sub.notify_tick((cycle_from, cycle_to), s, cps, bpc, mill, now)
except:
pass

# sys.stdout.write(
# "cps %.2f | playing %s | cycle %.2f\r"
Expand Down

0 comments on commit dc41ebc

Please sign in to comment.