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

eachFile* and eachDir methods should report useful errors

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-2
    • Fix Version/s: 1.0-JSR-3
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: