sshnet / sshnet/SSH.NET

More detailed exceptions?

Open
#346 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

Hi

Is it possible to make more detailed exceptions?
For example, I'm trying to upload the file which already exists on the server.
_client.UploadFile(stream, "Uploads/filename.txt", false);
I'm receiving Common.SshException with InnerException=null and Message="Failure"

I also receiving the same exception with this code (when remote file name is not specified):
_client.UploadFile(stream, "Uploads", false);

How can I understand where the bug is when all exceptions are the same?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the UploadFile entry point and reproduce both examples: uploading an existing remote file and omitting the remote filename. Trace how each failure becomes Common.SshException, then determine what distinct diagnostic information is available. Done means the two failure cases can be distinguished without relying on an empty InnerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.