@change Listeners Bypass Uncaught Exception Life Cycle
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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()
- Lenguaje dominante
- Python
- Estrellas
- 17
- Forks
- 16
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Kitware/trame-server
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Kitware/trame-server#63 · 8 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
Kitware/trame-server#30 · 2 comentarios ·
Todos los issues de Kitware/trame-server
Issues similares
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)Posiblemente ocupada @geyazheng la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
langchain-ai/langchain-aws#1469 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
EESSI/docs#949 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
b4b usability
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
fix(schedule): align list_tasks since cursor filter boundary from strict > to >=Posiblemente ocupada @bfs2021 la tomó hoy. Abiertoagent-ready bug p2 schedule
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
allenporter/supernote#540 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
frazane/scoringrules#164 ·
Los mantenedores suelen responder en 1 día