Error Handling - Adding "catch all" logic for &quo
Posted: Sun Sep 28, 2008 12:34 pm
Good afternoon to all,
Currently, we have some error handling in our logic which catches some type of errors, but not all. Here is an example of our error handling on one of our xml pages:
What I am looking to do is add logic which would catch and handle any other type of errors. So, this is what I came up with. My question is, does my logic make sense and is this how you would accomplish this:
Thanks,
Mike C.
Currently, we have some error handling in our logic which catches some type of errors, but not all. Here is an example of our error handling on one of our xml pages:
Code: Select all
<catch event="connection.disconnect">
<if cond="initial_recording == undefined">
<% if ( strFrom = "pause" ) then %>
<submit next="process_combine_voxs.xml?next=disconnect" method="post"/>
<% else %>
<submit next="process_record_hangup.xml?next=zerolength" method="post"/>
<% end if %>
<elseif cond="initial_recording$.size < 24000 || initial_recording$.size == ''"/>
<% if ( strFrom = "pause" ) then %>
<submit next="process_combine_voxs.xml?next=disconnect" method="post"/>
<% else %>
<submit next="process_record_hangup.xml?next=zerolength" method="post"/>
<% end if %>
<else/>
<submit next="process_record_savevox.xml?next=disconnect" method="post" namelist="initial_recording" fetchtimeout="120s" enctype="multipart/form-data"/>
</if>
</catch>
<catch event="error.badfetch" count="1">
<if cond="initial_recording$.size == 0 || initial_recording$.size == '' || initial_recording == undefined">
<submit next="process_record_hangup.xml?next=zerolength" method="post"/>
<else/>
<submit next="process_record_savevox.xml?next=disconnect" method="post" namelist="initial_recording" fetchtimeout="120s" enctype="multipart/form-data"/>
</if>
</catch>
<catch event="error.badfetch" count="2">
<var name="filename" expr="foldernumber + '_phone_file_' + filenumber + '.vox'"/>
<var name="recording" expr="initial_recording"/>
<submit next="http://metroscript.plumgroup.com/saverecording.php" namelist="filename recording" method="post" enctype="multipart/form-data"/>
</catch>
<catch event="nomatch noinput">
<submit next="process_record_hangup.xml" method="post"/>
</catch>
What I am looking to do is add logic which would catch and handle any other type of errors. So, this is what I came up with. My question is, does my logic make sense and is this how you would accomplish this:
Code: Select all
<error>
<if cond="_event =='connection.disconnect'">
<if cond="initial_recording == undefined">
<% if ( strFrom = "pause" ) then %>
<submit next="process_combine_voxs.xml?next=disconnect" method="post"/>
<% else %>
<submit next="process_record_hangup.xml?next=zerolength" method="post"/>
<% end if %>
<elseif cond="initial_recording$.size < 24000 || initial_recording$.size == ''"/>
<% if ( strFrom = "pause" ) then %>
<submit next="process_combine_voxs.xml?next=disconnect" method="post"/>
<% else %>
<submit next="process_record_hangup.xml?next=zerolength" method="post"/>
<% end if %>
<else/>
<submit next="process_record_savevox.xml?next=disconnect" method="post" namelist="initial_recording" fetchtimeout="120s" enctype="multipart/form-data"/>
</if>
<elseif cond="_event =='error.badfetch' " count="1"/>
<if cond="initial_recording$.size == 0 || initial_recording$.size == '' || initial_recording == undefined">
<submit next="process_record_hangup.xml?next=zerolength" method="post"/>
<else/>
<submit next="process_record_savevox.xml?next=disconnect" method="post" namelist="initial_recording" fetchtimeout="120s" enctype="multipart/form-data"/>
</if>
<elseif cond="_event =='error.badfetch' " count="2"/>
<var name="filename" expr="foldernumber + '_phone_file_' + filenumber + '.vox'"/>
<var name="recording" expr="initial_recording"/>
<submit next="http://metroscript.plumgroup.com/saverecording.php" namelist="filename recording" method="post" enctype="multipart/form-data"/>
<elseif cond="_event =='nomatch noinput' "/>
<submit next="process_record_hangup.xml" method="post"/>
<else/>
<submit next="process_record_savevox.xml?next=disconnect" method="post" namelist="initial_recording" fetchtimeout="120s" enctype="multipart/form-data"/>
</if>
</error>
Mike C.