@SafeVarargs
    public final UnframedGrpcErrorHandlerBuilder registerMarshalledMessageTypes(
            Class<? extends Message>... messageTypes) {
        requireNonNull(messageTypes, "messageTypes");
        checkState(jsonMarshaller == null,
                   "Cannot register custom messageTypes because a custom JSON marshaller has already been " +
                   "set. Use the custom marshaller to register custom message types.");

        if (marshalledMessageTypes == null) {
            marshalledMessageTypes = new ArrayList<>();
        }
        Collections.addAll(marshalledMessageTypes, messageTypes);
        return this;
    }
Registers custom message types to be marshalled by the error handler.

<p>This method registers specific message types for custom error responses.
If a custom JSON marshaller has already been set, calling this method will
result in an {@link IllegalStateException}.

@param messageTypes The message types to register
grpc/src/main/java/com/linecorp/armeria/server/grpc/UnframedGrpcErrorHandlerBuilder.java