Skip to content

Commit

Permalink
#339 Improved reporting of the ITDE errors (#340)
Browse files Browse the repository at this point in the history
* #339 Improved reporting of the ITDE errors

* #339 Addressed review comment [CodeBuild]
  • Loading branch information
ahsimb authored Oct 28, 2024
1 parent 67032c5 commit e3e0271
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
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

0 comments on commit e3e0271

Please sign in to comment.