enzostvs HF Staff commited on
Commit
8957bfe
·
1 Parent(s): ff45887
Files changed (1) hide show
  1. server.js +1 -2
server.js CHANGED
@@ -307,12 +307,11 @@ app.post("/api/ask-ai", async (req, res) => {
307
  // End the response stream
308
  res.end();
309
  } catch (error) {
310
- console.log(error);
311
  if (!res.headersSent) {
312
  res.status(500).send({
313
  ok: false,
314
  message:
315
- "An error occurred while processing your request. Please try again later.",
316
  });
317
  } else {
318
  // Otherwise end the stream
 
307
  // End the response stream
308
  res.end();
309
  } catch (error) {
 
310
  if (!res.headersSent) {
311
  res.status(500).send({
312
  ok: false,
313
  message:
314
+ error.message || "An error occurred while processing your request.",
315
  });
316
  } else {
317
  // Otherwise end the stream