You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
text: "You need to connect to a MongoDB instance before you can access its data.",
37
-
},
38
-
{
39
-
type: "text",
40
-
text: "Please use the 'connect' tool to connect to a MongoDB instance.",
41
-
},
42
-
],
43
-
isError: true,
44
-
};
41
+
if(errorinstanceofMongoDBError){
42
+
switch(error.code){
43
+
caseErrorCodes.NotConnectedToMongoDB:
44
+
return{
45
+
content: [
46
+
{
47
+
type: "text",
48
+
text: "You need to connect to a MongoDB instance before you can access its data.",
49
+
},
50
+
{
51
+
type: "text",
52
+
text: "Please use the 'connect' or 'switch-connection' tool to connect to a MongoDB instance.",
53
+
},
54
+
],
55
+
isError: true,
56
+
};
57
+
caseErrorCodes.MisconfiguredConnectionString:
58
+
return{
59
+
content: [
60
+
{
61
+
type: "text",
62
+
text: "The configured connection string is not valid. Please check the connection string and confirm it points to a valid MongoDB instance. Alternatively, use the 'switch-connection' tool to connect to a different instance.",
0 commit comments