File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ def start(self) -> "MCPClient":
220220 logger .exception ("client failed to initialize" )
221221 # Pass None for exc_type, exc_val, exc_tb since this isn't a context manager exit
222222 self .stop (None , None , None )
223- raise MCPClientInitializationError ("the client initialization failed" ) from e
223+ raise MCPClientInitializationError (f "the client initialization failed: { e } " ) from e
224224 return self
225225
226226 # ToolProvider interface methods
Original file line number Diff line number Diff line change @@ -386,7 +386,10 @@ def test_enter_with_initialization_exception(mock_transport):
386386 client = MCPClient (mock_transport ["transport_callable" ])
387387
388388 with patch .object (client , "stop" ) as mock_stop :
389- with pytest .raises (MCPClientInitializationError , match = "the client initialization failed" ):
389+ with pytest .raises (
390+ MCPClientInitializationError ,
391+ match = "the client initialization failed: Transport initialization failed" ,
392+ ):
390393 client .start ()
391394
392395 # Verify stop() was called for cleanup
You can’t perform that action at this time.
0 commit comments