Skip to content

Commit

Permalink
e as Error => (e as Error).message
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephVolosin committed Dec 9, 2024
1 parent 281501c commit b28cf0c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/packages/external-source/external-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ async function uploadExternalSource(req: Request, res: Response) {
} catch (e) {
logger.error(
`POST /uploadExternalSourceEventTypes: Body of request must be a JSON, with two stringified properties: "source" and "events". Alternatively, parsing may have failed:\n${
e as Error
(e as Error).message
}`,
);
res.status(500).send({
message: `Body of request must be a JSON, with two stringified properties: "source" and "events". Alternatively, parsing may have failed:\n${
e as Error
(e as Error).message
}`,
});
return;
Expand All @@ -249,6 +249,7 @@ async function uploadExternalSource(req: Request, res: Response) {
valid_at: valid_at,
},
};
console.log(period);

const headers: HeadersInit = {
Authorization: authorizationHeader ?? '',
Expand Down Expand Up @@ -282,7 +283,7 @@ async function uploadExternalSource(req: Request, res: Response) {
logger.error(
`POST /uploadExternalSourceEventTypes: The source and event types in your source do not exist in the database.`,
);
res.status(500).send({ message: `The source and event types in your source do not exist in the database.` });
res.status(500).send({ message: `The source type and event types in your source do not exist in the database.` });
return;
}

Expand Down

0 comments on commit b28cf0c

Please sign in to comment.