Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-692

Preserve ConversionException cause

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: Type conversion
    • Labels:
      None

      Description

      When improving the error message of the ConversionException thrown by the ConversionHandler in AbstractConfiguration.java:1768 the cause is lost.

      If for example a string is converted into a URL the MalformedURLException, that contains the actual reason for the failed conversion, is gone.

      A possible fix for that could be to attach the cause to the new ConversionException:

      AbstractConfiguration.java:1768:

      throw new ConversionException(
              String.format(
                      "Key '%s' cannot be converted to class %s. Value is: '%s'.",
                      key, cls.getName(), String.valueOf(value)), cex.getCause());

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              wolterhis Lars W
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: