UMRA – Web Portal Error Handling and Control

11:51 AM / Comments (0) / by Tech Admin

Have Questions? Email Me: Email Me Click Here

Tools4Ever’s Product Downloads Below.
Download User Management Resource Administrator > Download
Download Self Service Password Reset Manager SSRPM > Download
Download Enterprise Single Sign On Manager > Download

If you want to learn the basics on how to connect to UMRA with its COM object, please see my original post on “Basics of UMRA COM”.

UMRA – Web Portal Error Handling and Control

Anytime you build a UMRA based portal, or we build a UMRA based portal for our clients, one of the biggest steps in development is the handing all the errors that can happen with a specific UMRA script is executed. Before in some of my older blog posts I talked about how you can create a variable called %errorflag%, set it to 0 in the begging of your script, and if any part of your script throws and err, you can set this %errorflag% to 1. Then check the value of that variable via the COM object, and if its set to 1 then you know there is a problem with your script. Now, there are benefits and downfalls to doing it that way. One of the benefits is, if your script only does 1 action such as add a group to a user, then its easy to tell what the error is in the UMRA script, however, one downfall to this method is, if you have a script that does multiple things, you can code this into your UMRA script however that is a lot of overhead to program for each exception, so how do you get around this? Well, in the UMRA com there is a method called GetScript Exection Info. I don’t think many of our clients are using this method to check for error, however they should since it does all the error logic handling with a built in method.

Umra.GetScriptExectioninfo
This method has 2 Out parameters, the first is the Script Error Count, and second is the log message. Now after you have executed your script, just call this method and check the first return parameter, if it returned a 0 then we know the script ran without a hitch, but if it returns something other than 0 something went wrong, so then take the UMRA script log that is kicked back, and display it to the browser, or however you display your error messages.

So there you have it just another way to have your UMRA based portal wrapped in a little more error log. Again, both ways are great that we mentioned above for error handing, and it will be up to you to see what example works best. If you have any questions, please feel free to email me.

0 comments:

 
-->