Skip to content

Commit 1929df2

Browse files
committed
fix: backend hanging on error (incorrect error logging)
1 parent 3718943 commit 1929df2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/proxy/processors/push-action/getDiff.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ const exec = async (req: any, action: Action): Promise<Action> => {
1111
let commitFrom = `4b825dc642cb6eb9a060e54bf8d69288fbee4904`;
1212

1313
if (!action.commitData) {
14-
throw new Error('No commit data found');
14+
step.error = true;
15+
step.log('No commitData found');
16+
step.setError('Your push has been blocked because no commitData was found.');
17+
action.addStep(step);
18+
return action;
1519
}
1620

1721
if (action.commitFrom === '0000000000000000000000000000000000000000') {

src/proxy/processors/push-action/parsePush.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ async function exec(req: any, action: Action): Promise<Action> {
1717

1818
try {
1919
if (!req.body || req.body.length === 0) {
20-
throw new Error('No body found in request');
20+
step.log('No data received in request body.');
21+
step.setError('Your push has been blocked. No data received in request body.');
22+
action.addStep(step);
23+
return action;
2124
}
2225
const messageParts = req.body.toString('utf8').split(' ');
2326

0 commit comments

Comments
 (0)