mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-03-21 17:44:49 -05:00
Use appropriate error message and status code for register route
This commit is contained in:
parent
eb31c88f83
commit
83dab9bb5d
|
|
@ -345,15 +345,16 @@ router.post('/', async (request: express.Request, response: express.Response): P
|
|||
await pnid.save({ session });
|
||||
|
||||
await session.commitTransaction();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
LOG_ERROR('[POST] /v1/register: ' + error);
|
||||
if (error.stack) console.error(error.stack)
|
||||
|
||||
await session.abortTransaction();
|
||||
|
||||
response.status(400).json({
|
||||
response.status(500).json({
|
||||
app: 'api',
|
||||
status: 400,
|
||||
error: 'Password must have combination of letters, numbers, and/or punctuation characters'
|
||||
status: 500,
|
||||
error: 'Internal server error'
|
||||
});
|
||||
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user