We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe23fe6 commit acbc402Copy full SHA for acbc402
src/routes/api/index.ts
@@ -9,11 +9,15 @@ indexRoute.post(
9
res: Response<ResponseBody>
10
) => {
11
const { event_type: eventType, repo } = req.query;
12
- if (!eventType) {
13
- return res.status(400).send('event_type param missing');
14
- }
15
- if (!repo) {
16
- return res.status(400).send('repo param missing');
+ try {
+ if (!eventType) {
+ throw new Error('event_type param missing');
+ }
+ if (!repo) {
17
+ throw new Error('repo param missing');
18
19
+ } catch (e) {
20
+ return res.status(400).send(e.message);
21
}
22
23
try {
0 commit comments