Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-911

eachFile* and eachDir methods should report useful errors

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.0-JSR-2
    • 1.0-JSR-3
    • None
    • None

    Description

      The following two examples does not report a useful error message:

      File dir = new File("SomeNonExistingDir")
      dir.eachFile {
      println "${it} "
      }

      File dir = new File("${dirname_source}/GroovyClosureMethodsTest.groovy")
      dir.eachFile {
      println "${it} "
      }

      Included is a patch with these two test cases that attempts to resolve this by throwing exceptions.

      Attachments

        1. dir-exception-patch.txt
          5 kB
          Hein Meling

        Activity

          People

            sormuras sormuras
            meling Hein Meling
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: