reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dongjoon Hyun (JIRA)" <j...@apache.org>
Subject [jira] [Created] (REEF-1045) Add exception handling in LocalScratchSpace
Date Mon, 07 Dec 2015 11:56:10 GMT
Dongjoon Hyun created REEF-1045:
-----------------------------------

             Summary: Add exception handling in LocalScratchSpace
                 Key: REEF-1045
                 URL: https://issues.apache.org/jira/browse/REEF-1045
             Project: REEF
          Issue Type: Improvement
          Components: REEF-IO
            Reporter: Dongjoon Hyun
            Assignee: Dongjoon Hyun
            Priority: Minor


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

{code}
- // TODO: Error handling...
- ret += f.length();
+ try {
+   ret += f.length();
+ } catch (final SecurityException e) {
+   LOG.info("Fail to get file info:" + f.getAbsolutePath());
+ }
{code}

{code}
- // 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);
+ }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message