From e17d63083c0a01a66b62de4f7f1227aed3e4c7db Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 19 May 2020 13:10:20 +1000 Subject: [PATCH] catch protobuf error as well Sad that we can't exhaustively match protobuf oneofs in Python :-( --- pylib/anki/rsbackend.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pylib/anki/rsbackend.py b/pylib/anki/rsbackend.py index b95be4f33..eba0a4c4f 100644 --- a/pylib/anki/rsbackend.py +++ b/pylib/anki/rsbackend.py @@ -140,8 +140,11 @@ def proto_exception_to_native(err: pb.BackendError) -> Exception: return ExistsError() elif val == "deck_is_filtered": return DeckIsFilteredError() + elif val == "proto_error": + return StringError(err.localized) else: - assert_impossible_literal(val) + print("unhandled error type:", val) + return StringError(err.localized) def av_tag_to_native(tag: pb.AVTag) -> AVTag: