code: def check(cls, status):
          
          assert cls.trigger is not None, 'Invalid ErrorTrap, trigger not set'
          assert cls.error is not None, 'Invalid ErrorTrap, error not set'
  
          if status == cls.trigger:
              # pylint: disable=not-callable
              # cls.error will be callable at runtime
              raise cls.error()
docs: Checks if a status enum matches the trigger originally set, and
          if so, raises the appropriate error.
  
          Args:
              status (int, enum): A protobuf enum response status to check.
  
          Raises:
              AssertionError: If trigger or error were not set.
              _ApiError: If the statuses don't match. Do not catch. Will be
                  caught automatically and sent back to the client.