diff --git a/src/ert/__main__.py b/src/ert/__main__.py index 29a712478ac..aab9cdcbbb9 100755 --- a/src/ert/__main__.py +++ b/src/ert/__main__.py @@ -17,7 +17,7 @@ import ert.shared from _ert.threading import set_signal_handler -from ert.cli.main import ErtCliError, ErtTimeoutError, run_cli +from ert.cli.main import ErtCliError, run_cli from ert.config import ConfigValidationError, ErtConfig, lint_file from ert.logging import LOGGING_CONFIG from ert.mode_definitions import ( @@ -681,12 +681,12 @@ def main() -> None: with ErtPluginContext(logger=logging.getLogger()) as context: logger.info(f"Running ert with {args}") args.func(args, context.plugin_manager) - except (ErtCliError, ErtTimeoutError) as err: - logger.exception(str(err)) + except ErtCliError as err: + logger.debug(str(err)) sys.exit(str(err)) except ConfigValidationError as err: err_msg = err.cli_message() - logger.exception(err_msg) + logger.debug(err_msg) sys.exit(err_msg) except BaseException as err: logger.exception(f'ERT crashed unexpectedly with "{err}"') diff --git a/src/ert/cli/main.py b/src/ert/cli/main.py index 0d10d412d44..186e82c23e1 100644 --- a/src/ert/cli/main.py +++ b/src/ert/cli/main.py @@ -34,10 +34,6 @@ class ErtCliError(Exception): pass -class ErtTimeoutError(Exception): - pass - - def run_cli(args: Namespace, plugin_manager: Optional[ErtPluginManager] = None) -> None: ert_dir = os.path.abspath(os.path.dirname(args.config)) os.chdir(ert_dir) diff --git a/src/ert/gui/tools/plot/plot_window.py b/src/ert/gui/tools/plot/plot_window.py index 50b1fd27959..777129ad5a5 100644 --- a/src/ert/gui/tools/plot/plot_window.py +++ b/src/ert/gui/tools/plot/plot_window.py @@ -106,7 +106,7 @@ def __init__(self, config_file: str, parent: Optional[QWidget]): self._api = PlotApi() self._key_definitions = self._api.all_data_type_keys() except (RequestError, TimeoutError) as e: - logger.exception(e) + logger.exception(f"plot api request failed: {e}") open_error_dialog("Request failed", str(e)) self._key_definitions = [] QApplication.restoreOverrideCursor() @@ -191,7 +191,7 @@ def updatePlot(self, layer: Optional[int] = None) -> None: ensemble.id, key ) except (RequestError, TimeoutError) as e: - logger.exception(e) + logger.exception(f"plot api request failed: {e}") open_error_dialog("Request failed", f"{e}") observations = None @@ -201,7 +201,7 @@ def updatePlot(self, layer: Optional[int] = None) -> None: [ensembles.id for ensembles in selected_ensembles], key ) except (RequestError, TimeoutError) as e: - logger.exception(e) + logger.exception(f"plot api request failed: {e}") open_error_dialog("Request failed", f"{e}") std_dev_images: Dict[str, npt.NDArray[np.float32]] = {} @@ -221,7 +221,7 @@ def updatePlot(self, layer: Optional[int] = None) -> None: key, ensemble.id, layer ) except (RequestError, TimeoutError) as e: - logger.exception(e) + logger.exception(f"plot api request failed: {e}") open_error_dialog("Request failed", f"{e}") else: plot_widget.showLayerWidget.emit(False) @@ -241,7 +241,7 @@ def updatePlot(self, layer: Optional[int] = None) -> None: ) except (RequestError, TimeoutError) as e: - logger.exception(e) + logger.exception(f"plot api request failed: {e}") open_error_dialog("Request failed", f"{e}") plot_context.history_data = None