Skip to content

Commit

Permalink
Better error reporting for transcribe-url endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
philmcmahon committed Jan 27, 2025
1 parent 163505e commit 097d2de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@ const getApp = async () => {
const userEmail = req.user?.email;
const body = transcribeUrlRequestBody.safeParse(req.body);
const id = uuid4();
if (!body.success || !userEmail) {
res.status(422).send('missing request params');
if (!body.success) {
logger.error('Failed to parse transcribe url request', body.error);
res.status(422).send('Invalid request body');
return;
}
if (!userEmail) {
res.status(403).send('No user email property - is user loged in?');
return;
}
const downloadJob: MediaDownloadJob = {
Expand Down

0 comments on commit 097d2de

Please sign in to comment.