Skip to content

Commit

Permalink
feat: better error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrliu committed Nov 8, 2024
1 parent c989ade commit 35076b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -808,11 +808,10 @@ export function initGenericIssuanceRoutes(
}

if (!main.length) {
const errorPage = await readFileWithCache(
absPath.replace("index", "error")
throw new PCDHTTPError(
400,
`No ticket found with order code ${code} and email ${email}. Please contact [email protected] immediately.`
);
res.send(errorPage);
return;
}

const file = await readFileWithCache(absPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,7 @@ export class GenericIssuanceService {
(atom) => atom.orderCode === orderCode
);
if (!validAtom) {
throw new PCDHTTPError(
400,
`No ticket found with order code ${orderCode} and email ${email}`
);
return { tickets: [] } satisfies TicketPreviewResultValue;
}

const ticketDatas = tickets.atoms.map(
Expand Down

0 comments on commit 35076b7

Please sign in to comment.