Skip to content

Commit

Permalink
Prevent erroneous KataGo 1.15.0 error from generating an alert
Browse files Browse the repository at this point in the history
rooklift committed Jul 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 0c4b077 commit 3b99ec0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/engine.js
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ class Engine {
this.log_and_alert("Received non-JSON:", line);
return;
}
if (o.id === "test_bs29") { // Before the main check for errors.
if (o.id === "test_bs29") { // Before the main check for errors.
if (!o.error) {
this.log_and_alert(
"This build of KataGo appears to be compiled with \"bs29\" support for board sizes above 19. " +
@@ -214,6 +214,16 @@ class Engine {
}
return;
}
// KataGo 1.15.0 sends a mistaken error when sent the "query_version" command. We should ignore it once.
if (o.error === "'action' field must be 'query_version' or 'terminate' or 'terminate_all'") {
if (compare_versions([1, 15, 0], this.version) === 0) {
if (!this.saw_bad_1_15_0_error) {
this.saw_bad_1_15_0_error = true; // We only expect to see this once. Any further events are real errors I guess.
return;
}
}
}
// From here on we don't return early but try to use the object in any event...
if (o.error) {
alert("Engine said:\n" + stringify(o));
}

0 comments on commit 3b99ec0

Please sign in to comment.