From 4e32c54971f2d4fcbb5926c81c6eb46c8bb525f4 Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Oct 21 2019 18:52:01 +0000 Subject: Issue 50634 - Clean up CLI errors output - Fix wrong exception Description: The previous commit takes care only about ValueError evaluation. But it is possible that other exceptions will be raised which will result in a wrong error output. Make the exception object more general. https://pagure.io/389-ds-base/issue/50634 Reviewed by: ? --- diff --git a/src/lib389/lib389/cli_base/__init__.py b/src/lib389/lib389/cli_base/__init__.py index 23fc312..12b1c51 100644 --- a/src/lib389/lib389/cli_base/__init__.py +++ b/src/lib389/lib389/cli_base/__init__.py @@ -423,6 +423,6 @@ def format_error_to_dict(exception): errmsg = str(exception) try: msg = ast.literal_eval(errmsg) - except ValueError: + except Exception: msg = {'desc': errmsg} return msg