Permalink
Browse files

MDL-42792 SCORM: Prevent JS error when network connection fails. - re…

…turn false to SCORM package so that issue can be detected and reported.
  • Loading branch information...
1 parent e71a533 commit 8c5dd5e5eb4716aa83d6ac1d92be66f3212352b6 @danmarsden danmarsden committed Jan 10, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/scorm/request.js
View
@@ -41,7 +41,11 @@ function DoRequest(httpReq,url,param) {
//popupwin(url+"\n"+param);
httpReq.open("POST", url,false);
httpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- httpReq.send(param);
+ try {
+ httpReq.send(param);
+ } catch (e) {
+ return false;
+ }
if (httpReq.status == 200) {
//popupwin(url+"\n"+param+"\n"+httpReq.responseText);
return httpReq.responseText;

0 comments on commit 8c5dd5e

Please sign in to comment.