Skip to content

Commit

Permalink
test set_output_error
Browse files Browse the repository at this point in the history
  • Loading branch information
almazgimaev committed Oct 25, 2023
1 parent 721defd commit ae9eff6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions supervisely/train/src/sly_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +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)
raise e
msg = f"Something went wrong. Find more info in the app logs. {str(e)}"
my_app.show_modal_window(msg, level="error", log_message=False)
sly.logger.error(msg, exc_info=True, extra={ 'exc_str': str(e)})
api.task.set_output_error(task_id, msg)
api.app.set_field(task_id, "state.started", False)

# stop application
get_progress_cb("Finished, app is stopped automatically", 1)(1)
Expand Down

0 comments on commit ae9eff6

Please sign in to comment.