Skip to content

Commit 400bff1

Browse files
committed
handle 402 error for payment
1 parent 9d56da0 commit 400bff1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/tools/atlas/atlasTool.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ For more information on setting up API keys, visit: https://www.mongodb.com/docs
3838
};
3939
}
4040

41+
if (statusCode === 402) {
42+
return {
43+
content: [
44+
{
45+
type: "text",
46+
text: `Received a Payment Required API Error: ${error.message}
47+
48+
Payment setup is required to perform this action in MongoDB Atlas
49+
Please ensure that your payment method for your organization has been set up and is active.
50+
For more information on setting up payment, visit: https://www.mongodb.com/docs/atlas/billing/`,
51+
},
52+
],
53+
};
54+
}
55+
4156
if (statusCode === 403) {
4257
return {
4358
content: [

0 commit comments

Comments
 (0)