From 721defd6c0b6f8bdba48a6f348c6a8139bf9999e Mon Sep 17 00:00:00 2001 From: almaz Date: Wed, 25 Oct 2023 12:12:17 +0200 Subject: [PATCH] test the raising of exception --- supervisely/train/src/sly_train.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/supervisely/train/src/sly_train.py b/supervisely/train/src/sly_train.py index 691c4ae2b8f7..7597d4b2a4d7 100644 --- a/supervisely/train/src/sly_train.py +++ b/supervisely/train/src/sly_train.py @@ -128,10 +128,11 @@ def train(api: sly.Api, task_id, context, state, app_logger): upload_artifacts(g.local_artifacts_dir, g.remote_artifacts_dir) set_task_output() except Exception as e: - msg = f"Something went wrong. Find more info in the app logs. {repr(e)}" - my_app.show_modal_window(msg, level="error") - sly.logger.error(msg, exc_info=True, extra={ 'exc_str': str(e)}) - api.app.set_field(task_id, "state.started", False) + # msg = f"Something went wrong. Find more info in the app logs. {repr(e)}" + # my_app.show_modal_window(msg, level="error") + # sly.logger.error(msg, exc_info=True, extra={ 'exc_str': str(e)}) + # api.app.set_field(task_id, "state.started", False) + raise e # stop application get_progress_cb("Finished, app is stopped automatically", 1)(1) @@ -155,7 +156,7 @@ def main(): try: ui.init(data, state) except Exception as e: - raise Exception(f"Data loading or UI initialization error. {repr(e)}") + raise Exception(f"UI initialization error. {str(e)}") my_app.run(data=data, state=state)