Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C++] Add detail logs for schema related messages (#9544)
### Motivation If broker failed to parse the schema, the logs of C++/Python client is poor because when C++ client handles the `Error` response, it doesn't print the `message` field that is filled by broker. On the other hand, if the `InvalidSchemaDataException` is thrown by `StructSchemaDataValidator#throwInvalidSchemaDataException`, the detail error message will be written to the exception's cause. The String that `getMessage()` returns is not enough ### Modifications - When `tryAddSchema` failed, add the exception cause's message to the error message that's sent to client. - Print `Error` response's `message` field to logs. ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change is a trivial rework / code cleanup without any test coverage. Take #9483 (which is to be fixed) as the example, before this PR, the client side's log is like > Received error response from server: IncompatibleSchema -- req_id: 0 After this PR, the client side's log will be > Received error response from server: IncompatibleSchema (Invalid schema definition data for AVRO schema caused by org.apache.avro.SchemaParseException: Undefined name: "array") -- req_id: 0
- Loading branch information