Commit 9539e807 authored by edwin's avatar edwin

add error message

parent ee93443f
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
}); });
}) })
.catch(error => console.log('error', error)); .catch(error => console.error("Unable to fetch lightbox.html" + error));
} }
} }
...@@ -237,7 +237,10 @@ ...@@ -237,7 +237,10 @@
let response = await fetch(`${baseurl}api/asset/more?scrollId=${scrollId}`, config) let response = await fetch(`${baseurl}api/asset/more?scrollId=${scrollId}`, config)
.then(response => response.json()) .then(response => response.json())
.catch(error => addDebugMessage(error)); .catch(error => {
addDebugMessage("Fetch error on fetchSKU - Scroll : " + error);
throw new Error("Fetch error on fetchSKU - Scroll : " + error);
});
assetlist = assetlist.concat(response.assets); assetlist = assetlist.concat(response.assets);
...@@ -247,7 +250,10 @@ ...@@ -247,7 +250,10 @@
return assetlist; return assetlist;
}) })
.catch(error => console.error(error)); .catch(error => {
addDebugMessage("Fetch error on fetchSKU : " + error);
throw new Error("Fetch error on fetchSKU : " + error);
});
} }
// filter asset by Date // filter asset by Date
...@@ -321,7 +327,10 @@ ...@@ -321,7 +327,10 @@
"body": json "body": json
}) })
.then(response => response.json()) .then(response => response.json())
.catch(error => console.error(error)); .catch(error => {
addDebugMessage("Fetch error on DownloadList - POST request: " + error);
throw new Error("Fetch error on DownloadList - POST request: " + error);
});
// send GET request for downloading the zip file // send GET request for downloading the zip file
fetch(`/api/asset/download/${response.token}`, getConfig(getHeader())) fetch(`/api/asset/download/${response.token}`, getConfig(getHeader()))
...@@ -339,7 +348,10 @@ ...@@ -339,7 +348,10 @@
addDebugMessage(`download ${name}.zip completed`); addDebugMessage(`download ${name}.zip completed`);
}) })
.catch(error => console.error(error)); .catch(error => {
addDebugMessage("Fetch error on DownloadList - GET request: " + error);
throw new Error("Fetch error on DownloadList - GET request: " + error);
});
}else if(assetlist.length === 1){ }else if(assetlist.length === 1){
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
#fetch-lightbox .debug-box{ #fetch-lightbox .debug-box{
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-top: 10px; padding-top: 12px;
} }
#fetch-lightbox .asset-item{ #fetch-lightbox .asset-item{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment