Skip to content

Commit

Permalink
- display error on load if things go wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Jan 19, 2024
1 parent 67f0e93 commit 0992604
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/plain/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
document.getElementById("yaml").value = "{}";
document.getElementById('inputfile').value = "";
document.getElementById("data").innerHTML = "";
document.getElementById("chart").innerHTML = "";
destroy();
document.getElementById("chart").innerHTML = "";
};

function runSimulation() {
Expand Down Expand Up @@ -86,10 +85,12 @@
if (copasi == null) {
return;
}
copasi.destroy();
copasi.initCps();
var info = copasi.loadModel(document.getElementById("cps").value);
console.log(info['model']['name']);
document.getElementById("modelName").innerHTML = "none";
if (info['status'] != "success") {
alert("Error loading model: " + info['messages']);
return;
}
document.getElementById("modelName").innerHTML = info['model']['name'];

}
Expand Down

0 comments on commit 0992604

Please sign in to comment.