You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Adrian Sandor (JIRA)" <ji...@apache.org> on 2008/02/27 18:43:51 UTC

[jira] Created: (IVY-751) SFTPRepository.list(String) hides exceptions

SFTPRepository.list(String) hides exceptions
--------------------------------------------

                 Key: IVY-751
                 URL: https://issues.apache.org/jira/browse/IVY-751
             Project: Ivy
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.0-beta-1, 2.0.0-beta-2
            Reporter: Adrian Sandor


With an sftp repository, if any connection or authentication problem happens, the error is hidden and the code behaves as if the action succeeded but nothing was found. This makes it very hard to identify the problem and fix the configuration.
I tracked the issue to the list method in SFTPRepository, where I found:

        catch (Exception e) {
            // silent fail, return null listing
        }

I would change the code to something like this:

        catch (SftpException e) {
            IOException ioe = new IOException();
            ioe.initCause(e);
            throw ioe;
        }

so any exception will be thrown as an IOException.
I'm sure there are other options too.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IVY-751) SFTPRepository.list(String) hides exceptions

Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xavier Hanin updated IVY-751:
-----------------------------

    Fix Version/s: 2.0

> SFTPRepository.list(String) hides exceptions
> --------------------------------------------
>
>                 Key: IVY-751
>                 URL: https://issues.apache.org/jira/browse/IVY-751
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-beta-1, 2.0.0-beta-2
>            Reporter: Adrian Sandor
>             Fix For: 2.0
>
>
> With an sftp repository, if any connection or authentication problem happens, the error is hidden and the code behaves as if the action succeeded but nothing was found. This makes it very hard to identify the problem and fix the configuration.
> I tracked the issue to the list method in SFTPRepository, where I found:
>         catch (Exception e) {
>             // silent fail, return null listing
>         }
> I would change the code to something like this:
>         catch (SftpException e) {
>             IOException ioe = new IOException();
>             ioe.initCause(e);
>             throw ioe;
>         }
> so any exception will be thrown as an IOException.
> I'm sure there are other options too.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (IVY-751) SFTPRepository.list(String) hides exceptions

Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maarten Coene resolved IVY-751.
-------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.0)
                   2.0-RC1
         Assignee: Maarten Coene

Fixed in trunk. Could you give it a try because I don't have a SFTP server to test it out?

> SFTPRepository.list(String) hides exceptions
> --------------------------------------------
>
>                 Key: IVY-751
>                 URL: https://issues.apache.org/jira/browse/IVY-751
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-beta-1, 2.0.0-beta-2
>            Reporter: Adrian Sandor
>            Assignee: Maarten Coene
>             Fix For: 2.0-RC1
>
>
> With an sftp repository, if any connection or authentication problem happens, the error is hidden and the code behaves as if the action succeeded but nothing was found. This makes it very hard to identify the problem and fix the configuration.
> I tracked the issue to the list method in SFTPRepository, where I found:
>         catch (Exception e) {
>             // silent fail, return null listing
>         }
> I would change the code to something like this:
>         catch (SftpException e) {
>             IOException ioe = new IOException();
>             ioe.initCause(e);
>             throw ioe;
>         }
> so any exception will be thrown as an IOException.
> I'm sure there are other options too.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.