Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout on errors #4

Open
saulortega opened this issue Mar 3, 2014 · 1 comment
Open

Timeout on errors #4

saulortega opened this issue Mar 3, 2014 · 1 comment

Comments

@saulortega
Copy link

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.. :(

@smallfish
Copy link
Owner

Thanks for report this, i will test and fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants