Skip to content

Commit 383fcd6

Browse files
committed
fix(dashboard-api): catch buffering timed out error during transaction attempts
1 parent 5d34cf8 commit 383fcd6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/dashboard-api/src/controllers/project.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ module.exports.createProject = async (req, res) => {
308308
session.endSession();
309309
}
310310

311-
if (err.message && err.message.includes("Transaction numbers are only allowed")) {
311+
if (err.message && (err.message.includes("Transaction numbers are only allowed") || err.message.includes("buffering timed out"))) {
312312
try {
313313
const { projectObj, newProject } = await executeOperation(null);
314314
emitEvent(req.user._id, 'project_created', { projectName: projectObj.name }, newProject._id);
@@ -743,7 +743,7 @@ module.exports.createCollection = async (req, res) => {
743743
session.endSession();
744744
}
745745

746-
if (err.message && err.message.includes("Transaction numbers are only allowed")) {
746+
if (err.message && (err.message.includes("Transaction numbers are only allowed") || err.message.includes("buffering timed out"))) {
747747
try {
748748
const { project, projectId, collectionName } = await executeOperation(null);
749749
await deleteProjectById(projectId);

0 commit comments

Comments
 (0)