Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-266

Remove double logging in ConnectionHelper

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0.0 M3
    • 2.0.0 M3
    • Kernel
    • None

      When an error occurs while connecting to the database there is two errors logged.
      First, the real error with the cause, and then the IllegalArgumentException without the cause.

      In order to access more efficiency to the cause a single exception would be nice.

      The proposed patch:

      Index: main/kernel/src/org/ametys/runtime/datasource/ConnectionHelper.java
      ===================================================================
      --- main/kernel/src/org/ametys/runtime/datasource/ConnectionHelper.java	(revision 596)
      +++ main/kernel/src/org/ametys/runtime/datasource/ConnectionHelper.java	(working copy)
      @@ -91,8 +91,7 @@
               }
               catch (SQLException e)
               {
      -            _logger.error("Unable to get Connection from pool " + poolName, e);
      -            throw new IllegalArgumentException("Unable to get Connection from pool " + poolName);
      +            throw new RuntimeException("Unable to get Connection from pool " + poolName, e);
               }
       
               return conn;
      

            Unassigned Unassigned
            yabon SĂ©bastien Launay (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: