checkValid function

void checkValid(
  1. GeneratedMessage message
)

Validates the given message according to the constraints defined in Protobuf and throws an InvalidMessageError if the message is invalid.

Implementation

void checkValid(GeneratedMessage message) {
    var error = validate(message);
    error.ifPresent((e) => throw InvalidMessageError._(e));
}