Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#339 Improved reporting of the ITDE errors #340

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/changes_3.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Code name:
## Refactorings

* #333: Added project short tag in notebook tests
* #339: Improved error reporting when the DockerDB doesn't start properly.

## Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"from exasol.nb_connector.ai_lab_config import AILabConfig as CKey, StorageBackend\n",
"from exasol.nb_connector.itde_manager import (bring_itde_up, get_itde_status, restart_itde, take_itde_down, ItdeContainerStatus)\n",
"from exasol.nb_connector.connections import get_backend\n",
"from exasol_integration_test_docker_environment.lib.api.api_errors import TaskFailures, TaskRuntimeError\n",
"\n",
"\n",
"class ITDEStatus(Enum):\n",
Expand Down Expand Up @@ -196,6 +197,20 @@
" return get_onprem_db_config_ui(conf)\n",
"\n",
"\n",
"def _itde_error_message(header: str, e: Exception) -> str:\n",
" if isinstance(e, TaskRuntimeError):\n",
" if isinstance(e.__cause__, TaskFailures):\n",
" err_message = f'{e.msg} {e.__cause__}'\n",
" elif e.inner:\n",
" causes = '\\n'.join(e.inner)\n",
" err_message = f'{e.msg} This was caused by\\n{causes}'\n",
" else:\n",
" err_message = e.msg\n",
" else:\n",
" err_message = str(e)\n",
" return f'{header}: {err_message}'\n",
"\n",
"\n",
"def _get_docker_db_action_buttons(conf: Secrets, itde_exists: bool, itde_ready: bool, \n",
" display_status: widgets.Widget) -> List[widgets.Button]:\n",
" \"\"\"\n",
Expand All @@ -220,7 +235,7 @@
" display_status.value = ITDEStatus.ready.value\n",
" btn.icon = 'check'\n",
" except Exception as e:\n",
" popup_message('Failed to start the Exasol Docker-DB:' + str(e))\n",
" popup_message(_itde_error_message('Failed to start the Exasol Docker-DB', e))\n",
" \n",
" def restart_docker_db(btn):\n",
" try:\n",
Expand All @@ -234,7 +249,7 @@
" display_status.value = ITDEStatus.ready.value\n",
" btn.icon = 'check'\n",
" except Exception as e:\n",
" popup_message('Failed to restart the Exasol Docker-DB:' + str(e))\n",
" popup_message(_itde_error_message('Failed to restart the Exasol Docker-DB:', e))\n",
"\n",
" if itde_ready:\n",
" btn_restart = widgets.Button(description='Recreate and Start')\n",
Expand Down