Support short error messages for status field
authorJoey Schulze <joey@infodrom.org>
Sun, 28 Feb 2010 16:53:34 +0000 (17:53 +0100)
committerJoey Schulze <joey@infodrom.org>
Sun, 28 Feb 2010 16:53:34 +0000 (17:53 +0100)
lib/functions.js

index a145482..ea1d587 100644 (file)
@@ -7,7 +7,10 @@ function ajax_request_callback(req)
        var data = json_parse(req.responseText);
 
        if (typeof data.error == 'string') {
-           error('Fehler im AJAX-Backend');
+           if (typeof data.errormsg == 'string')
+               error(data.errormsg);
+           else
+               error('Fehler im AJAX-Backend');
            alert("Fehler im AJAX backend:\n" + data.error);
        } else if (req.oncomplete)
            req.oncomplete(data);