Skip to content

Commit

Permalink
remove catch all statement for vue renderer
Browse files Browse the repository at this point in the history
Why hide errors from the gui?

Change-Id: I0c8c71ac3f86f49f8d75a281f0af6eb4bc256340
  • Loading branch information
BenediktSeidl committed Aug 14, 2024
1 parent d1649c7 commit 6a5ede3
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions cmk/gui/form_specs/vue/form_spec_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import json
import pprint
import traceback
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from typing import Any, Literal, TypeVar
Expand Down Expand Up @@ -148,16 +147,13 @@ def render_form_spec(
display_mode: RenderMode = RenderMode.EDIT,
) -> None:
"""Renders the valuespec via vue within a div"""
try:
vue_app_config = serialize_data_for_frontend(
form_spec, field_id, origin, do_validate, value, display_mode
)
logger.warning("Vue app config:\n%s", pprint.pformat(vue_app_config, width=220, indent=2))
logger.warning("Vue value:\n%s", pprint.pformat(vue_app_config.data, width=220))
logger.warning("Vue validation:\n%s", pprint.pformat(vue_app_config.validation, width=220))
html.div("", data_cmk_vue_app=json.dumps(asdict(vue_app_config)))
except Exception as e:
logger.warning("".join(traceback.format_exception(e)))
vue_app_config = serialize_data_for_frontend(
form_spec, field_id, origin, do_validate, value, display_mode
)
logger.warning("Vue app config:\n%s", pprint.pformat(vue_app_config, width=220, indent=2))
logger.warning("Vue value:\n%s", pprint.pformat(vue_app_config.data, width=220))
logger.warning("Vue validation:\n%s", pprint.pformat(vue_app_config.validation, width=220))
html.div("", data_cmk_vue_app=json.dumps(asdict(vue_app_config)))


def parse_data_from_frontend(form_spec: FormSpec[T], field_id: str) -> Any:
Expand Down

0 comments on commit 6a5ede3

Please sign in to comment.