Skip to content

Move SftpPathNotFoundException.Path down to SftpException - #1856

Open
Rob-Hague wants to merge 1 commit into
sshnet:developfrom
Rob-Hague:sftpexception-path
Open

Rob-Hague wants to merge 1 commit into
sshnet:developfrom
Rob-Hague:sftpexception-path

Conversation

@Rob-Hague

Copy link
Copy Markdown
Collaborator

And populate it in more places (where the error could not relate to any other path).

And populate it in more places (where the error could not relate to any other path).
@drieseng

drieseng commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

@Rob-Hague, what's the rationale for this? Looking at thus on cell phone, so I surely missed the big picture.

@Rob-Hague

Copy link
Copy Markdown
Collaborator Author

Yes sorry I should have said:
Looking back through old issues, there are lots of complaints of unspecific exceptions in the SFTP layer. There is not a lot we can do about it, especially when the server sends just "Failure" code, but #1716 in 2025.1.0 improved it slightly by adding a base SftpException class with the SFTP error code, and added Path property to SftpPathNotFoundException. Here I figured Path can be provided in more cases where it would not be considered ambiguous, so the property can be moved to the base class.

This is not considered a breaking change in .NET guidelines: https://learn.microsoft.com/dotnet/core/compatibility/library-change-rules)

✔️ ALLOWED: Moving a member into a class higher in the hierarchy than the type from which it was removed

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants