You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by "Yunseong Lee (JIRA)" <ji...@apache.org> on 2016/02/25 07:31:18 UTC

[jira] [Updated] (REEF-1045) Add exception handling in LocalScratchSpace

     [ https://issues.apache.org/jira/browse/REEF-1045?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yunseong Lee updated REEF-1045:
-------------------------------
    Fix Version/s: 0.14

> 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
>             Fix For: 0.14
>
>
> 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)