fix error code

This commit is contained in:
Omer Sabic 2024-06-07 22:27:46 +02:00
parent ab00a416e8
commit 67b7849b39

View File

@ -31,7 +31,6 @@ export const authRoutes = (fastify, _, done) => {
console.log("existing user", existing_user);
let user;
let session_id;
let errorCode;
await db.transaction(async tx => {
try {
if (existing_user) {
@ -87,7 +86,6 @@ export const authRoutes = (fastify, _, done) => {
}
} catch (e) {
console.log(e);
errorCode = e.message;
await tx.rollback();
return;
}
@ -112,7 +110,7 @@ export const authRoutes = (fastify, _, done) => {
response.status(400).send("Your account does not have a youtube channel. Please make one.")
}
console.log(e);
response.send({ success: false, message: "There was a problem when making your account.", ...(errorCode ? {debug: errorCode} : "") });
response.send({ success: false, message: "There was a problem when making your account." });
return;
}
});