Jump to content
UBot Underground

Recommended Posts

I am still building my first bot as a way of learning ubot. 

I am building a cpanel backup and restore bot but although I am able to do most of the things required, my bot depends on the correct information being inputted by the user.

How do I catch errors such as incorrect username etc?

 

Can anyone point me in the direction of a tutorial for this or, better still, some source code for me to look at, I will pay if need be. 

I have looked in the bot bank but none of these seem to try to trap errors, do I need to?

 

Thanks,

 

Clint

 

I think I have solved this, I took the URL and compared it to what I would expect it to be, if it matched then the script continues, if it doesn't it flags an error and stops.

Is this the correct (best) way to do it?

 

Thanks,

Clint

Link to post
Share on other sites

You should be catching errors by looking at success page, and if you are not on success page it means something is wrong. So, for incorrect username you would check if you are logged in into cpanel (for example check if innertext="phpmyadmin" exists) or you could even check if you are still on login page (if login button exists).

 

If you want to have a robust application you should be doing that, yes.

 

Using URLs for that may not work as well as the approach above...what if URL is equal to the one you expected but the server will display another page (like 500 internal server error).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...