Uploaded image for project: 'REEF (Retired)'
  1. REEF (Retired)
  2. REEF-1045

Add exception handling in LocalScratchSpace

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.14
    • REEF-IO
    • None

    Description

      This issue implements two TODOs in `LocalScratchSpace.java` by implementing exception handling logic.

      - // TODO: Error handling...
      - ret += f.length();
      + try {
      +   ret += f.length();
      + } catch (final SecurityException e) {
      +   LOG.info("Fail to get file info:" + f.getAbsolutePath());
      + }
      
      - // TODO: Error handling. Files.delete() would give us an exception. We
      - // should pass a set of Exceptions into a ReefRuntimeException.
         for (final File f : tempFiles) {
      -    f.delete();
      +   try {
      +     if (!f.delete()) {
      +       throw new RuntimeException("Fail to delete file:" + f.getAbsolutePath());
      +     }
      +   } catch (final SecurityException e) {
      +     throw new RuntimeException("Fail to delete file:" + f.getAbsolutePath(), e);
      + }
      

      Attachments

        Issue Links

          Activity

            People

              dongjoon Dongjoon Hyun
              dongjoon Dongjoon Hyun
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: