Add gRPC warning for the unsuccessful deserialization attempt

Align the deserialization error handling with the serialization.

Pick-to: 6.8
Change-Id: I5901f8191232b532bbc0b6f1b80f858e88711065
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
This commit is contained in:
Alexey Edelev 2024-08-24 15:04:25 +02:00
parent 119add5fde
commit e1a9d0dbee
1 changed files with 6 additions and 1 deletions

View File

@ -114,7 +114,12 @@ bool QGrpcOperation::read(QProtobufMessage *message) const
Q_D(const QGrpcOperation);
const auto ser = d->operationContext->serializer();
Q_ASSERT_X(ser, "QGrpcOperation", "The serializer is null");
return ser->deserialize(message, d->data);
if (!ser->deserialize(message, d->data)) {
qGrpcWarning() << "Unable to deserialize message("<< ser->lastError() <<"): "
<< ser->lastErrorString();
return false;
}
return true;
}
/*!