Better errormessages for ajax

Posts from previous Beta sessions

Better errormessages for ajax

Postby poetter » Mon Dec 24, 2007 4:29 pm

Hi,

what about doing this?

Code: Select all
--- C:/Dokumente und Einstellungen/Daniel/Lokale Einstellungen/Temp/mainjs.js-revBASE.svn000.tmp.js   Mon Dec 24 08:24:23 2007
+++ D:/xampp/roster.com/htdocs/js/mainjs.js   Mon Dec 24 08:22:35 2007
@@ -431,6 +431,9 @@
       {
 //         Unescape this to show the result XML in a popup for debugging.
 //         alert(req.responseText);
+          if ( req.responseXML == null ) {
+            alert(req.responseText.replace(/<\/?[^>]+>/gi, ''));
+         } else {
          response = req.responseXML.documentElement;
          cont = response.getElementsByTagName('cont')[0].firstChild.data;
          result = response.getElementsByTagName('result')[0];
@@ -443,6 +446,7 @@
          else
          {
             alert('Error '+status+': '+errmsg.firstChild.data);
+            }
          }
       }
       else


This way we get a speaking error message on fatal errors in ajax scripts
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Better errormessages for ajax

Postby zanix » Mon Dec 24, 2007 4:35 pm

Done svn[1558]
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US


Return to Archived

Who is online

Users browsing this forum: No registered users and 0 guests