This can be helpful when there are bugs constructing the metadata, for example constructing an ASCII header with a non-ASCII value. Prior to this commit this would result in the server disconnecting without any kind of helpful error message, because the exception was actually triggered deep in the bowels of http2. We now trigger it earlier, so that we throw the appropriate exception. For example:
CustomMetadata "x-wrong-header" "\x00"
will result in
Invalid: CustomMetadata "x-wrong-header" "\NUL" at <callstack>
on the server, which will then propagate to the client as
GrpcException {
grpcError = GrpcUnknown
, grpcErrorMessage = Just "Invalid: CustomMetadata \"x-wrong-header\" \"\\NUL\" at <callstack>"
, grpcErrorMetadata = []
}
This can be helpful when there are bugs constructing the metadata, for example constructing an ASCII header with a non-ASCII value. Prior to this commit this would result in the server disconnecting without any kind of helpful error message, because the exception was actually triggered deep in the bowels of
http2
. We now trigger it earlier, so that we throw the appropriate exception. For example:will result in
on the server, which will then propagate to the client as