Skip to content

SftpPathNotFoundException doesn't contain the errored path #567

@Deantwo

Description

@Deantwo

It is weird to debug an error throwing a Renci.SshNet.Common.SftpPathNotFoundException exception since it doesn't actually say what the path was.

It should be trivial to add another property to the SftpPathNotFoundException class and assign it in the constructor. Preferably the argument shouldn't be optional though.

Exception in my specific case is thrown from here:

Renci.SshNet.Common.SftpPathNotFoundException: No such file
     at Renci.SshNet.Sftp.SftpSession.RequestOpenDir(String path, Boolean nullOnError)
     at Renci.SshNet.Sftp.SftpSession.ChangeDirectory(String path)
     at Renci.SshNet.SftpClient.ChangeDirectory(String path)
     at <my code>

Finding the bug in my code isn't too hard, just requires me to add some more/better exception handling and logging of my ChangeDirectory call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions