It may be worth putting a try/except around every method and using the mapping provided in [`code.proto`](https://github.com/googleapis/googleapis/blob/034b4cdaacf13764f70ba55205ea6f9734652cc0/google/rpc/code.proto) See #2496.