clintk 2 Posted February 15, 2014 Report Share Posted February 15, 2014 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 Quote Link to post Share on other sites
UBotDev 276 Posted February 15, 2014 Report Share Posted February 15, 2014 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). Quote Link to post Share on other sites
clintk 2 Posted February 16, 2014 Author Report Share Posted February 16, 2014 I never thought of that, Thanks for your advice Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.