Author: mwringe
Date: 2011-10-24 10:03:23 -0400 (Mon, 24 Oct 2011)
New Revision: 7851
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js
Log:
GTNPORTAL-2230: handle error situation better. This should hopefully not cause anymore
issues with other AJAX requests.
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js 2011-10-24
11:17:48 UTC (rev 7850)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js 2011-10-24
14:03:23 UTC (rev 7851)
@@ -537,9 +537,8 @@
target = document.getElementById(blockToUpdate.blockId) ;
}
if(target == null) {
- alert(eXo.i18n.I18NMessage.getMessage("TargetBlockNotFound", new
Array (blockToUpdate.blockId))) ;
- return ;
- }
+ throw new
Error(eXo.i18n.I18NMessage.getMessage("TargetBlockNotFound", new Array
(blockToUpdate.blockId)));
+ }
var newData = eXo.core.DOMUtil.findDescendantById(blockToUpdate.data,
blockToUpdate.blockId) ;
//var newData = blockToUpdate.data.getElementById(blockToUpdate.blockId) ;
if(newData == null)
alert(eXo.i18n.I18NMessage.getMessage("BlockUpdateNotFound", new Array
(blockToUpdate.blockId))) ;
@@ -625,10 +624,14 @@
if(confirm(eXo.i18n.I18NMessage.getMessage("SessionTimeout")))
instance.ajaxTimeout(request) ;
}
//Handle the portal responses
- if (instance.updateBlocks(response.blocksToUpdate) != null) {
- instance.updateHtmlHead(response);
- instance.executeScript(response.script) ;
- }
+ try {
+ instance.updateBlocks(response.blocksToUpdate);
+ instance.updateHtmlHead(response);
+ instance.executeScript(response.script) ;
+ }
+ catch (error) {
+ alert(error.message) ;
+ }
/**
* Clears the instance.to timeout if the request takes less time than expected to
get response
* Removes the transparent mask so the UI is available again, with cursor
"auto"
Show replies by date