@change Listeners Bypass Uncaught Exception Life Cycle
まだ誰も着手していません。
評価
調査の方向性
Start with the exception example at examples/exceptions/app_trame.py and reproduce the issue by adding the shown @change listener that raises an error. The issue says this began in trame-server==3.13.2 after #95; inspect that change and trace how listener exceptions reach the life cycle handler. Done when the exception life cycle event fires for errors raised by a @change listener.
索引モデルが issue の本文から書いたものです。
説明
If you take the exception example and add a @change listener with an error in the code, the life cycle event will be bypassed.
This did not start occurring until trame-server==3.13.2 after #95.
Modified app_trame.py Example
Click to expand
import logging
import sys
import traceback
from trame.app import TrameApp
from trame.ui.html import DivLayout
from trame.widgets import html
from trame.decorators import change, life_cycle
# Disable default stdout exception
logging.getLogger("wslink.protocol").setLevel(logging.CRITICAL)
class MonitorException(TrameApp):
def __init__(self, server=None):
super().__init__(server)
self.server.state.test = 1
self._build_ui()
# self.ctrl.on_exception.add(self.on_exception)
def _build_ui(self):
with DivLayout(self.server) as self.ui:
html.Button("Divide by 0", click=self.divide_by_zero)
html.Button("JS error", click="console.error('Yo')")
html.Button("Divide by 0 in change listener", click="test += 1")
def divide_by_zero(self):
return 1 / 0
@life_cycle.exception
def on_exception(self, exception):
print(">" * 60)
print("exception ->", exception)
traceback.print_exception(
type(exception), exception, exception.__traceback__, file=sys.stdout
)
print("<" * 60)
@life_cycle.error
def on_js_error(self, msg):
if msg == "[object Object]":
# exception... => should fix JS to send a better msg/event
return
print("JS error:", msg)
@change("test")
def test_is_changed(self, **_):
return 1 / 0
def main():
app = MonitorException()
app.server.start()
if __name__ == "__main__":
main()
- 主要言語
- Python
- スター
- 17
- フォーク
- 16
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kitware/trame-server のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
Kitware/trame-server#63 · コメント 8 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
Kitware/trame-server#30 · コメント 2 件 ·
Kitware/trame-server の issue をすべて見る
似ている issue
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)対応中かも @geyazheng が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
langchain-ai/langchain-aws#1469 ·
メンテナーはふだん 1 日以内に返信
-
GCToggler leaves collection enabled if the body re-enables it対応中かも @Gambit-Checkmate が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 7 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
doronz88/pymobiledevice3#2176 ·
メンテナーはふだん 1 日以内に返信
-
b4b usability
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信