08-23-2018 09:14 AM
May be a dumb question. I have uccx scripts and i want to handle exceptions. I'd like to capture the exception message and put in a string variable for later use. When i look at the on exception goto step it appears that you would be able to do that with the save root cause (optional) portion. I have tried every variable type and it does not see in the drop down. Is there a way to do this??? I only want to use the exception message to persist somewhere else so i may review later.
Solved! Go to Solution.
08-23-2018 10:31 AM - edited 06-01-2020 10:57 AM
In the On Exception Goto Step, it's looking for a variable of type Exception.
If you want to store the exception message as a human readable string, then you need to create another variable, of type String, and then use the Set Step to set your String to the .getMessage() return value of the Exception.
E.g.,
Variables
Exception the_exception = null String the_exception_message = "" int i = 0
Script Steps
On Exception WFExecutionException Goto HandleException (Save root cause to the_exception) Set i = 1 / 0 HandleException: Set the_exception_message = the_exception.getMessage()
EDIT: Removed the "l" in the method name and placed the variables/steps in a prefixed font box (looks nicer)
08-23-2018 10:41 AM
LOL must be blind as I wasn't seeing the exception variable as an option. Now I do. Thanks. This solves my issue.
08-23-2018 10:31 AM - edited 06-01-2020 10:57 AM
In the On Exception Goto Step, it's looking for a variable of type Exception.
If you want to store the exception message as a human readable string, then you need to create another variable, of type String, and then use the Set Step to set your String to the .getMessage() return value of the Exception.
E.g.,
Variables
Exception the_exception = null String the_exception_message = "" int i = 0
Script Steps
On Exception WFExecutionException Goto HandleException (Save root cause to the_exception) Set i = 1 / 0 HandleException: Set the_exception_message = the_exception.getMessage()
EDIT: Removed the "l" in the method name and placed the variables/steps in a prefixed font box (looks nicer)
08-23-2018 10:41 AM
LOL must be blind as I wasn't seeing the exception variable as an option. Now I do. Thanks. This solves my issue.
11-22-2019 01:16 PM
This thread is really helpful...researching CCX exceptions the thread below helped me understand the WFExecutionException. Is there an Anthony fan club?! +5 and thanks!
11-22-2019 01:51 PM
06-01-2020 10:44 AM
I dont understand Anthony. I cannot do the steps you say to do below in my UCCX10.6 with CCX Premium license, it doesn't work. First you say its looking for a variable of type Exception. There is no choice for that type of variable. You say to create a variable as string, which I did. Then what do you mean by the set step? It doesn't like the syntax of .getMessageI() I have tried every variable and not one of them shows up as a choice in the 'Save root cause (optional) selection box.
Then whats even more confusing is this. When I create a variable, there is no where to put any of this stuff below
Variable
Exception the_exception = null
String the_exception_message = ""
int i = 0
06-01-2020 11:00 AM
06-01-2020 05:09 PM
Ok, I was able to create a variable out of nothing called of type Exception. I never knew you could do that. I then studied your other post about the runner script and how you syn taxed the set statement with the exception variable that I created. Everything took so Im ready to test it out, BUT, i changed my gateway IP of the UCCX so I could do the e-mail thing and the license MAC changed so Im waiting on TAC to re-host it for me. I have to tell you, it is acting very strange since the license MAC changed. All of my apps, when you call into them, they do answer but no prompts at all play. None of the apps. Just dead air but the phone call is still connected. Even though it says I have 57 days left on the temp license, it rendered the UCCX useless if you cant hear the prompts. Thank you for your help!
06-01-2020 05:50 PM
06-02-2020 03:55 PM
It was a network issue. I had forgotten that my phones were on a different sub net than what the gateway sub net was. Something even stranger is going on now. I have my on exception step triggering on WFExcecutionException so it will branch to my Handle Exception part in the script that will e mail me a message that the script broke. I left the save root cause part blank so Im not even trying to capture the root cause. All I want it to do is e mail me my preset message that something broke. Then after it e-mails me it goes to call the customer service girl step so at least the original caller gets help from a live person rather than the script just hanging up on them because something in the script broke. All of this works perfect, EXCEPT it sends 107 e-mails to me. Why? I just want one e mail sent to me that my script broke. Whats up with the looping of the e mail send step?
06-02-2020 06:14 PM
06-02-2020 06:35 PM
06-02-2020 06:40 PM
06-02-2020 09:37 PM
06-03-2020 08:01 AM
NICE Job Anthony, the 'clear exception' step. Its right there in front of my eyes but never thought to use it. Live and learn. So I went back and did it right, to capture the actual reported error and e-mail me that error. The e-mail only came once, which is far better that 105 emails at once, but, to make sense out of a 'readable' exception message, thats another feat in itself which will come with time. SO like I mentioned, I have UCCX pulling a database record that doesn't exist as the test and the readable message in the e-mail is 'null; nested exception is:
java.lang.ArrayIndexOutOfBoundsException (line: 1, col: 1)". Right... lol.. this is good stuff though. I read that other guys full report on how he had all the exception messages mapped out. must have took him days. I will settle for my message above just to let me know the script broke. I know what my scripts do so hopefully I can correlate the cryptic Cisco message with what I *think* may have happened. Thanks again for you help!!!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide