Skip to content

Commit f0093e5

Browse files
committed
Added alert in mapping UI in case the mapping fails
1 parent 324cafa commit f0093e5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/main/resources/static/JS/mapDocument.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ function map() {
3232
http.responseType = 'blob';
3333

3434
http.onload = () => {
35-
let content_dispo = http.getResponseHeader("content-disposition");
36-
let filename = content_dispo.substr(content_dispo.lastIndexOf("=") + 1);
37-
let content_type =http.getResponseHeader("content-type");
38-
console.log("Downloading result to " + filename + " with content type " + content_type);
39-
download(http.response, filename, content_type);
35+
if(http.status === 200){
36+
let content_dispo = http.getResponseHeader("content-disposition");
37+
let filename = content_dispo.substr(content_dispo.lastIndexOf("=") + 1);
38+
let content_type =http.getResponseHeader("content-type");
39+
console.log("Downloading result to " + filename + " with content type " + content_type);
40+
download(http.response, filename, content_type);
41+
}else{
42+
alert("A remote mapping error occured. Please check server logs for details.")
43+
}
4044
document.getElementById("progress").hidden = true
4145
document.getElementById("downloadButton").hidden = true
4246
document.getElementById("submit").disabled = false

0 commit comments

Comments
 (0)