Skip to content

More detailed exceptions? #346

Closed
Closed

Description

@tattdogg

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?

Activity

  1. IgorMilavec commented on Feb 12, 2022

    @IgorMilavec
    Contributor

    As far as I understand, the protocol itself does not provide more specific information about the cause of the failure. What could be done is to provide some context, so in the first case you would get a SshException with the message Failed to upload file 'Uploads/filename.txt': Failure.
    Would that help?

  2. Rob-Hague commented on Oct 19, 2026

    @Rob-Hague
    Collaborator

    #1716 / 2025.1.0 improves it, notwithstanding the above mentioned limitation

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

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