Skip to content

Commit 888d5a9

Browse files
committed
fix: try catch.
1 parent be3cb23 commit 888d5a9

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

core/database/foxx/api/schema_router.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ router
609609
status: "Failure",
610610
description: `Delete schema. Schema ID: ${req.queryParams.id}`,
611611
extra: { deleted: sch_old?._id },
612+
error: e,
612613
});
613614
g_lib.handleException(e, res);
614615
}
@@ -692,22 +693,19 @@ router
692693
},
693694
});
694695
} catch (e) {
695-
try {
696-
logger.logRequestFailure({
697-
client: req.queryParams?.client,
698-
correlationId: req.headers["x-correlation-id"],
699-
httpVerb: "GET",
700-
routePath: basePath + "/view",
701-
status: "Failure",
702-
description: `View schema. Schema ID: ${req.queryParams.id}`,
703-
extra: {
704-
pub: sch?.pub,
705-
sys: sch?.sys,
706-
},
707-
});
708-
} catch (logErr) {
709-
console.error("Logger failed:", logErr);
710-
}
696+
logger.logRequestFailure({
697+
client: req.queryParams?.client,
698+
correlationId: req.headers["x-correlation-id"],
699+
httpVerb: "GET",
700+
routePath: basePath + "/view",
701+
status: "Failure",
702+
description: `View schema. Schema ID: ${req.queryParams.id}`,
703+
extra: {
704+
pub: sch?.pub,
705+
sys: sch?.sys,
706+
},
707+
error: e,
708+
});
711709
g_lib.handleException(e, res);
712710
}
713711
})

0 commit comments

Comments
 (0)