Skip to content

Errors are not saved on close-session error #141

Description

@robege-eri

When the session is closed, the "close-session" netconf message is sent.
If any netconf errors occurs during the close, they are not propagated to the user.

In session.go (Close) we have:

// This may fail so save the error but still close the underlying transport.
req := NewRPC(&closeSession{})
resp, _ := s.Do(ctx, req)
if resp != nil {
    _ = resp.Close()
}

The comment indicates that errors from this operation are saved, but there are no traces of this in the code.
The resp variable is not used anywhere else in the code.

If this code is replaced by;

// This may fail so save the error but still close the underlying transport.
closeErr = s.Exec(ctx, &closeSession{}, nil)

I suppose by doing this, the errors should be extracted from the response and saved in closeErr ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions