Skip to content

Commit 532801a

Browse files
handled exception properly for failed http get.
1 parent 6ad2b5b commit 532801a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

doc_crosslinks/crosslink_redirect.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,16 @@
7272
return baseUri + escapeCharacters(dirtyName);
7373
}
7474

75-
function checkResourceExists(url) {
76-
var xmlHttp = new XMLHttpRequest();
77-
xmlHttp.open( "GET", url, false );
78-
xmlHttp.send( null );
79-
return xmlHttp.status == 200;
75+
function checkResourceExists(url) {
76+
try {
77+
var xmlHttp = new XMLHttpRequest();
78+
xmlHttp.open( "GET", url, false );
79+
xmlHttp.send( null );
80+
return xmlHttp.status == 200;
81+
}
82+
catch(err) {
83+
return false;
84+
}
8085
}
8186

8287
var url = window.location.href;

0 commit comments

Comments
 (0)