File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
extensions/cli/src/services Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,11 @@ class MCPConnection {
221221 ) ;
222222 await this . client . connect ( transport , { } ) ;
223223 this . transport = transport ;
224- } else if ( ! this . options . type ) {
224+ } else if ( this . options . type ) {
225+ throw new Error (
226+ `Unsupported transport type: ${ this . options . type } ` ,
227+ ) ;
228+ } else {
225229 try {
226230 const transport = this . constructHttpTransport ( {
227231 ...this . options ,
@@ -243,10 +247,6 @@ class MCPConnection {
243247 ) ;
244248 }
245249 }
246- } else {
247- throw new Error (
248- `Unsupported transport type: ${ this . options . type } ` ,
249- ) ;
250250 }
251251 }
252252
Original file line number Diff line number Diff line change @@ -372,7 +372,9 @@ export class MCPService
372372 } else if ( serverConfig . type === "streamable-http" ) {
373373 const transport = this . constructHttpTransport ( serverConfig ) ;
374374 await client . connect ( transport , { } ) ;
375- } else if ( ! serverConfig . type ) {
375+ } else if ( serverConfig . type ) {
376+ throw new Error ( `Unsupported transport type: ${ serverConfig . type } ` ) ;
377+ } else {
376378 try {
377379 const transport = this . constructHttpTransport ( serverConfig ) ;
378380 await client . connect ( transport , { } ) ;
@@ -392,8 +394,6 @@ export class MCPService
392394 ) ;
393395 }
394396 }
395- } else {
396- throw new Error ( `Unsupported transport type: ${ serverConfig . type } ` ) ;
397397 }
398398 }
399399
You can’t perform that action at this time.
0 commit comments