Skip to content

Commit

Permalink
controlled errs
Browse files Browse the repository at this point in the history
  • Loading branch information
kadamidev committed Dec 16, 2024
1 parent 0c58692 commit 5c46fbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions desci-server/src/controllers/auth/orcid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const validateOrcid = async (req: Request, res: Response) => {
res.send({ data, ok: true });
} catch (err) {
logger.error({ err, fn: 'validateOrcid', req });
res.status(400).send({ ok: false, err });
res.status(400).send({ ok: false, msg: 'Validation failed' });
}
};

Expand Down Expand Up @@ -144,7 +144,7 @@ const processOrcidConnect = async (req: Request, res: Response, closing: boolean
return;
} catch (err) {
logger.error({ fn: 'processOrcidConnect', err }, 'error processing orcid connect');
res.status(400).send({ err });
res.status(400).send('Orcid connect failed');
}
};

Expand Down Expand Up @@ -203,6 +203,6 @@ const processOrcidAuth = async (req: Request, res: Response, closing: boolean) =
return;
} catch (err) {
logger.error({ fn: 'processOrcidAuth', err }, 'error processing orcid auth');
res.status(400).send({ err });
res.status(500).send({ msg: 'processing ORCID auth failed' });
}
};

0 comments on commit 5c46fbc

Please sign in to comment.