Fix validation error causing 400 response

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/d4a37844-692f-4de3-b9be-1b0c92eb2eb5.jpg
This commit is contained in:
alphaeusmote
2025-04-11 17:24:59 +00:00
+1
View File
@@ -997,6 +997,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
res.status(201).json(token);
} catch (error) {
if (error instanceof z.ZodError) {
console.log("API Token Validation error details:", JSON.stringify(error.errors, null, 2));
res.status(400).json({ message: "Validation error", errors: error.errors });
} else {
console.error("Error creating API token:", error);