Skip to content

Timeout on errors #4

@saulortega

Description

@saulortega

If my user doesn't have write permissions, occurs this:

<cmd>
<code> 220
<message> (vsFTPd 2.3.5)
<cmd> USER xxxxxxxxxx
<code> 331
<message> Please specify the password.
<cmd> PASS yyyyyyyyyyyyyy
<code> 230
<message> Login successful.
<cmd> PASV
<code> 227
<message> Entering Passive Mode (127,0,0,1,39,156).
<cmd> STOR hola.go
<code> 550
<message> Permission denied.
<response> OK

And the program don't exits. How can I terminate the program if un error occurs, or after a timeout?

I tried to add this (after ftp.Stor("hola.go", b)):

if ftp.Code == 550 {
fmt.Println("error: permissions failure")
os.Exit(-1)
}

but it does not work.. :(

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