Skip to content

Commit d366e25

Browse files
committed
chore: Apply formatter
1 parent 1998f17 commit d366e25

File tree

4 files changed

+535
-529
lines changed

4 files changed

+535
-529
lines changed

mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/server/transport/WebFluxStreamableServerTransportProvider.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ else if (message instanceof McpSchema.JSONRPCRequest jsonrpcRequest) {
273273
Mono<Void> stream = session.responseStream(jsonrpcRequest, st);
274274
Disposable streamSubscription = stream.onErrorComplete(err -> {
275275
if (err instanceof McpParamsValidationError) {
276-
var errorResponse = new McpSchema.JSONRPCResponse(McpSchema.JSONRPC_VERSION, jsonrpcRequest.id(),
277-
null, new McpSchema.JSONRPCResponse.JSONRPCError(McpSchema.ErrorCodes.INVALID_PARAMS,
278-
err.getMessage(), null));
276+
var errorResponse = new McpSchema.JSONRPCResponse(McpSchema.JSONRPC_VERSION,
277+
jsonrpcRequest.id(), null, new McpSchema.JSONRPCResponse.JSONRPCError(
278+
McpSchema.ErrorCodes.INVALID_PARAMS, err.getMessage(), null));
279279

280280
var event = ServerSentEvent.builder()
281-
.event(MESSAGE_EVENT_TYPE)
282-
.data(errorResponse)
283-
.build();
281+
.event(MESSAGE_EVENT_TYPE)
282+
.data(errorResponse)
283+
.build();
284284

285285
sink.next(event);
286286
return true;

mcp-spring/mcp-spring-webmvc/src/main/java/io/modelcontextprotocol/server/transport/WebMvcStreamableServerTransportProvider.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,14 @@ else if (message instanceof McpSchema.JSONRPCRequest jsonrpcRequest) {
389389
session.responseStream(jsonrpcRequest, sessionTransport)
390390
.contextWrite(ctx -> ctx.put(McpTransportContext.KEY, transportContext))
391391
.block();
392-
} catch (McpParamsValidationError e) {
393-
var errorResponse = new McpSchema.JSONRPCResponse(McpSchema.JSONRPC_VERSION, jsonrpcRequest.id(), null,
394-
new McpSchema.JSONRPCResponse.JSONRPCError(McpSchema.ErrorCodes.INVALID_PARAMS, e.getMessage(), null));
392+
}
393+
catch (McpParamsValidationError e) {
394+
var errorResponse = new McpSchema.JSONRPCResponse(McpSchema.JSONRPC_VERSION,
395+
jsonrpcRequest.id(), null, new McpSchema.JSONRPCResponse.JSONRPCError(
396+
McpSchema.ErrorCodes.INVALID_PARAMS, e.getMessage(), null));
395397
sessionTransport.sendMessage(errorResponse).block();
396-
} catch (Exception e) {
398+
}
399+
catch (Exception e) {
397400
logger.error("Failed to handle request stream: {}", e.getMessage());
398401
sseBuilder.error(e);
399402
}

0 commit comments

Comments
 (0)