mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
catch protobuf error as well
Sad that we can't exhaustively match protobuf oneofs in Python :-(
This commit is contained in:
parent
08f1843b67
commit
e17d63083c
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue