Skip to content

Commit

Permalink
Bugfix: Do not alert on plot runtime errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LaCuneta committed Jun 5, 2024
1 parent 79dfb48 commit 3509482
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/assets/javascripts/beak/widgets/set-up-widgets.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,22 @@ runWithErrorHandling = (source, reportError, f, code) ->
try
f() is StopInterrupt
catch ex
if not (ex instanceof Exception.HaltInterrupt)
isHaltInterrupt = (_ex) ->
(_ex instanceof Exception.HaltInterrupt)

# just swallow plot runtime errors to not interrupt the user
isPlotError = (_source, _ex) ->
(_ex instanceof Exception.RuntimeException) and
_source is 'button' and
_ex.stackTrace.length > 0 and
_ex.stackTrace[0].type is 'plot'

if not isHaltInterrupt(ex)
if isPlotError(source, ex)
return false

reportError("runtime", source, ex, code)

true

# ((String, String, Exception) => Unit, () => Unit, Button, () => Any) => () => Unit
Expand Down

0 comments on commit 3509482

Please sign in to comment.