This is an automated email from the ASF dual-hosted git repository.

dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 749581d  fix(log): don't log exceptions on test connection (#10522)
749581d is described below

commit 749581d534cae0abf1e532df44b7a7f5f9b31ed7
Author: Daniel Vaz Gaspar <[email protected]>
AuthorDate: Thu Aug 6 07:58:22 2020 +0100

    fix(log): don't log exceptions on test connection (#10522)
    
    * fix(log): don't log exceptions on test connection
    
    * fix lint
---
 superset/views/core.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index ce25692..bcbce02 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1120,10 +1120,10 @@ class Superset(BaseSupersetView):  # pylint: 
disable=too-many-public-methods
                 conn.scalar(select([1]))
                 return json_success('"OK"')
         except CertificateException as ex:
-            logger.info(ex.message)
+            logger.info("Certificate exception")
             return json_error_response(ex.message)
-        except (NoSuchModuleError, ModuleNotFoundError) as ex:
-            logger.info("Invalid driver %s", ex)
+        except (NoSuchModuleError, ModuleNotFoundError):
+            logger.info("Invalid driver")
             driver_name = make_url(uri).drivername
             return json_error_response(
                 _(
@@ -1132,24 +1132,24 @@ class Superset(BaseSupersetView):  # pylint: 
disable=too-many-public-methods
                 ),
                 400,
             )
-        except ArgumentError as ex:
-            logger.info("Invalid URI %s", ex)
+        except ArgumentError:
+            logger.info("Invalid URI")
             return json_error_response(
                 _(
                     "Invalid connection string, a valid string usually 
follows:\n"
                     "'DRIVER://USER:PASSWORD@DB-HOST/DATABASE-NAME'"
                 )
             )
-        except OperationalError as ex:
-            logger.warning("Connection failed %s", ex)
+        except OperationalError:
+            logger.warning("Connection failed")
             return json_error_response(
-                _("Connection failed, please check your connection 
settings."), 400
+                _("Connection failed, please check your connection settings"), 
400
             )
         except DBSecurityException as ex:
-            logger.warning("Stopped an unsafe database connection. %s", ex)
+            logger.warning("Stopped an unsafe database connection")
             return json_error_response(_(str(ex)), 400)
         except Exception as ex:  # pylint: disable=broad-except
-            logger.error("Unexpected error %s", ex)
+            logger.error("Unexpected error %s", type(ex).__name__)
             return json_error_response(
                 _("Unexpected error occurred, please check your logs for 
details"), 400
             )

Reply via email to