chiark / gitweb /
errors: Handle Inapplicable errors in the client
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 13 Jul 2021 17:57:09 +0000 (18:57 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 13 Jul 2021 18:21:16 +0000 (19:21 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index f65d97d61bb488576c0fa22ab4d5670d8e5a83ba..ff132745e6fcaffb7575f09ef4f3b7aedad2bca0 100644 (file)
@@ -2009,8 +2009,13 @@ update_error_handlers.PieceOpError = <MessageHandler>function
   let cseq = m.state.cseq;
   let p = pieces[piece];
   console.log('ERROR UPDATE PIECE ', piece, cseq, m, m.error_msg, p);
-  if (p == null) return;
-  let conflict_expected = piece_error_handlers[m.error](piece, p, m);
+  if (p == null) return; // who can say!
+  if (m.error != 'Conflict') {
+    // Our gen was high enough we we sent this, that it ought to have
+    // worked.  Report it as a problem, then.
+    add_log_message('Problem manipulating piece: ' + m.error_msg);
+    p.cseq = null; // Well, we don't have anything outstanding now
+  }
   handle_piece_update(m.state);
 }