Better error logging for wasm test page

This commit is contained in:
Abhishek Aggarwal 2021-04-29 16:51:13 +02:00 committed by abhi-agg
parent 3525af6a45
commit 2788116f8b

View File

@ -65,7 +65,7 @@ En consecuencia, durante el año 2011 se introdujeron 180 proyectos de ley que r
const downloadAsArrayBuffer = async(url) => {
const response = await fetch(url);
if (!response.ok) {
throw Error(`HTTP ${response.status} - ${response.statusText}`);
throw Error(`Downloading ${url} failed: HTTP ${response.status} - ${response.statusText}`);
}
return response.arrayBuffer();
}
@ -156,7 +156,7 @@ quiet-translation: true
console.debug("Creating TranslationModel with config:", modelConfigWithoutModelAndShortList);
translationModel = new Module.TranslationModel(modelConfigWithoutModelAndShortList, alignedModelMemory, alignedShortlistMemory);
} catch (error) {
console.error(error);
log(error);
}
}