Skip to content

Commit 17e0b17

Browse files
authored
fix: errors on bookmark are now surfaced in the Python console (#2076)
1 parent 39d680d commit 17e0b17

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4949

5050
* Fixed false positive warning in `layout_columns()` about number of widths vs elements. (#1704)
5151

52+
* When errors occur in a bookmarking context, they are now reported in the Python console. (#2076)
53+
5254
### Bug fixes
5355

5456
* Fixed numerous issues related to programmatically updating selectize options. (#2053)

shiny/bookmark/_bookmark.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -558,15 +558,10 @@ async def do_bookmark(self) -> None:
558558
await self.show_bookmark_url_modal(full_url)
559559

560560
except Exception as e:
561-
msg = f"Error bookmarking state: {e}"
562-
from ..ui._notification import notification_show
563-
564-
notification_show(
565-
msg,
566-
duration=None,
567-
type="error",
568-
session=self._root_session,
569-
)
561+
from ..types import NotifyException
562+
563+
msg = f"Error bookmarking state: {str(e)}"
564+
raise NotifyException(msg) from e
570565

571566

572567
class BookmarkProxy(Bookmark):

shiny/reactive/_reactives.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,10 @@ async def _run(self) -> None:
597597
from ..ui import notification_show
598598

599599
msg = str(e)
600+
warnings.warn(msg, ReactiveWarning, stacklevel=2)
600601
if e.sanitize:
601602
msg = SANITIZE_ERROR_MSG
602-
notification_show(msg, type="error", duration=5000)
603+
notification_show(msg, type="error", duration=None)
603604
if e.close:
604605
await self._session._unhandled_error(e)
605606
except Exception as e:

0 commit comments

Comments
 (0)