add exception handlers to all demos

pull/293/head
Vladimir Mandic 2021-04-25 14:30:40 -04:00
parent f26dae059e
commit ed0fbd6e3c
6 changed files with 18 additions and 5 deletions

View File

@ -11,6 +11,7 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
### **HEAD -> main** 2021/04/25 mandic00@live.com
- major update for 1.8 release candidate
### **origin/main** 2021/04/25 mandic00@live.com

View File

@ -34,6 +34,3 @@ Build:
- Build NodeJS deliverables in non-minified form
### TBD
- Remove modelPaths
- NodeJS Exception handling

View File

@ -34,7 +34,7 @@
</div>
<span id="desc" style="visibility: hidden; font-size: 0.4rem;"></span><br>
</div>
<div style="height: 10px"></div>
<div id="list" style="height: 10px"></div>
Extracted Faces - click on a face to sort by similarity and get a known face match:<br>
<div id="faces"></div>
</div>

View File

@ -168,6 +168,13 @@ async function createDB() {
}
async function main() {
window.addEventListener('unhandledrejection', (evt) => {
// eslint-disable-next-line no-console
console.error(evt.reason || evt);
document.getElementById('list').innerHTML = evt?.reason?.message || evt?.reason || evt;
evt.preventDefault();
});
// pre-load human models
await human.load();

View File

@ -588,6 +588,14 @@ async function drawWarmup(res) {
}
async function main() {
window.addEventListener('unhandledrejection', (evt) => {
// eslint-disable-next-line no-console
console.error(evt.reason || evt);
document.getElementById('log').innerHTML = evt?.reason?.message || evt?.reason || evt;
status('exception error');
evt.preventDefault();
});
log('demo starting ...');
// parse url search params

2
wiki

@ -1 +1 @@
Subproject commit 906244487754b61fd24f49fe2db91ea68264137d
Subproject commit 11c9fd09a38aa5876a13befb41012e8997ba84c9