completionId: cgen-67bc47e559c64fb5a4b202d0fa29ead9
cgen-67bc47e559c64fb5a4b202d0fa29ead9
This commit is contained in:
parent
214b05d846
commit
3db09e5287
1 changed files with 2 additions and 0 deletions
|
|
@ -187,8 +187,10 @@ export default async function handler(
|
|||
return res.status(405).json({ error: "Method not allowed" });
|
||||
} catch (error: any) {
|
||||
console.error("API error:", error);
|
||||
// Ensure we always return JSON, never HTML
|
||||
return res.status(500).json({
|
||||
error: error?.message || "Internal server error",
|
||||
type: "api_error",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue