mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-09 22:31:10 +00:00
add try catch in api/add for better error handling
This commit is contained in:
parent
dde7f21c5e
commit
d267a8d436
1 changed files with 5 additions and 0 deletions
|
|
@ -69,6 +69,7 @@ app.get("/api/health", (c) => {
|
|||
});
|
||||
|
||||
app.post("/api/add", zValidator("json", vectorObj), async (c) => {
|
||||
try{
|
||||
const body = c.req.valid("json");
|
||||
|
||||
const { store } = await initQuery(c);
|
||||
|
|
@ -101,6 +102,10 @@ app.post("/api/add", zValidator("json", vectorObj), async (c) => {
|
|||
});
|
||||
|
||||
return c.json({ status: "ok" });
|
||||
}catch(error){
|
||||
console.error("Error processing request:", error);
|
||||
return c.json({ status: "error", message: error.message }, 500);
|
||||
}
|
||||
});
|
||||
|
||||
app.post(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue