Detecting FTP errors

20 pts.
Tags:
CLP
RPGLE
Hi! I have a program that reads an FTP log and sends the user a message if there's an error (4xx or 5xx). But there are some errors that do not indicate which is the error code (like connection errors). How can I capture these errors? Thanx in advance. Meli :)

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Melissa

You could use reverse logic and instead of the program assuming a connection is made and checking for an error, assume that the connection is not made and check for a successful connection.

If a connection attempt is successful then the server will return a 2xx code which you can check for. My logic would be something along the lines of:

Eval Connected = False
Do until end of LogFile
Read LogFile
If record Found
If Connected = True
…current program processing…
Else
If return code “2xx” then
Connected = True
End If
End If
End Do

If Connected = False
Send error message
End If

Hope it helps

Jonathan

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following