mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
improve transfer error log and TestSCPErrors
This commit is contained in:
parent
bd0eb2f0a8
commit
f4507aeec2
2 changed files with 7 additions and 3 deletions
|
@ -2003,8 +2003,6 @@ func TestSCPErrors(t *testing.T) {
|
|||
t.Skip("scp command not found, unable to execute this test")
|
||||
}
|
||||
u := getTestUser(true)
|
||||
u.UploadBandwidth = 4096
|
||||
u.DownloadBandwidth = 4096
|
||||
user, _, err := api.AddUser(u, http.StatusOK)
|
||||
if err != nil {
|
||||
t.Errorf("unable to add user: %v", err)
|
||||
|
@ -2023,6 +2021,12 @@ func TestSCPErrors(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Errorf("error uploading file via scp: %v", err)
|
||||
}
|
||||
user.UploadBandwidth = 512
|
||||
user.DownloadBandwidth = 512
|
||||
_, _, err = api.UpdateUser(user, http.StatusOK)
|
||||
if err != nil {
|
||||
t.Errorf("unable to update user: %v", err)
|
||||
}
|
||||
cmd := getScpDownloadCommand(localPath, remoteDownPath, false, false)
|
||||
go func() {
|
||||
if cmd.Run() == nil {
|
||||
|
|
|
@ -40,7 +40,7 @@ type Transfer struct {
|
|||
// For example network or client issues
|
||||
func (t *Transfer) TransferError(err error) {
|
||||
t.transferError = err
|
||||
logger.Warn(logSender, t.connectionID, "Unexpected error for transfer, path: %#v, error: %#v bytes sent: %v, "+
|
||||
logger.Warn(logSender, t.connectionID, "Unexpected error for transfer, path: %#v, error: \"%v\" bytes sent: %v, "+
|
||||
"bytes received: %v", t.path, t.transferError, t.bytesSent, t.bytesReceived)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue