Skip to content

Commit

Permalink
Updated error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaS7 committed Jan 7, 2024
1 parent 841c2c1 commit cc5840c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ app.get("/api/database/search", async (req, res) => {
res.status(200).json({ search });
} catch (error) {
console.error("Error fetching results:", error);
res.status(500).json({ error: "Internal Server Error" });
res.status(500).json({ error: "Internal Server Error", message: err.message });
}
});

Expand Down Expand Up @@ -82,7 +82,7 @@ app.post("/api/database/new", async (req,res) => {
}
} catch (error) {
console.error("Error adding record:", error);
res.status(500).json({ error: "Internal Server Error" })
res.status(500).json({ error: "Internal Server Error", message: err.message })
}
});

Expand Down

0 comments on commit cc5840c

Please sign in to comment.