fix error code
This commit is contained in:
parent
ab00a416e8
commit
67b7849b39
@ -31,7 +31,6 @@ export const authRoutes = (fastify, _, done) => {
|
|||||||
console.log("existing user", existing_user);
|
console.log("existing user", existing_user);
|
||||||
let user;
|
let user;
|
||||||
let session_id;
|
let session_id;
|
||||||
let errorCode;
|
|
||||||
await db.transaction(async tx => {
|
await db.transaction(async tx => {
|
||||||
try {
|
try {
|
||||||
if (existing_user) {
|
if (existing_user) {
|
||||||
@ -87,7 +86,6 @@ export const authRoutes = (fastify, _, done) => {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
errorCode = e.message;
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
return;
|
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.")
|
response.status(400).send("Your account does not have a youtube channel. Please make one.")
|
||||||
}
|
}
|
||||||
console.log(e);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user