public UnframedGrpcErrorHandlerBuilder jsonMarshaller(MessageMarshaller jsonMarshaller) {
        requireNonNull(jsonMarshaller, "jsonMarshaller");
        checkState(marshalledMessages == null && marshalledMessageTypes == null,
                   "Cannot set a custom JSON marshaller because one or more Message instances or " +
                   "Message types have already been registered. To set a custom marshaller, " +
                   "ensure that no Message or Message type registrations have been made before " +
                   "calling this method."
        );
        this.jsonMarshaller = jsonMarshaller;
        return this;
    }
Sets a custom JSON marshaller to be used by the error handler.

<p>This method allows the caller to specify a custom JSON marshaller
for encoding the error responses. If messages or message types have
already been registered, calling this method will result in an
{@link IllegalStateException}. If nothing is specified,
the default JSON marshaller is used.

@param jsonMarshaller The custom JSON marshaller to use
grpc/src/main/java/com/linecorp/armeria/server/grpc/UnframedGrpcErrorHandlerBuilder.java