Skip to content

Commit 7486aaa

Browse files
committed
fix: parsePush error handling
1 parent b2126db commit 7486aaa

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,9 @@ const decompressGitObjects = async (buffer: Buffer): Promise<GitObject[]> => {
497497

498498
// stop on errors, except maybe buffer errors?
499499
const onError = (e: unknown) => {
500-
error = e instanceof Error ? e : new Error(String(e));
501-
console.warn(`Error during inflation: ${JSON.stringify(e)}`);
502-
error = new Error('Error during inflation', { cause: e });
500+
const msg = getErrorMessage(e);
501+
console.warn(`Error during inflation: ${msg}`);
502+
error = new Error(`Error during inflation: ${msg}`);
503503
inflater.end();
504504
done = true;
505505
if (currentWriteResolve) currentWriteResolve();
@@ -523,10 +523,10 @@ const decompressGitObjects = async (buffer: Buffer): Promise<GitObject[]> => {
523523
offset++;
524524
}
525525
});
526-
} catch (error: unknown) {
527-
const msg = `Error during decompression: ${error instanceof Error ? error.message : String(error)}`;
528-
console.warn(msg);
529-
throw new Error(msg);
526+
} catch (e: unknown) {
527+
const msg = getErrorMessage(e);
528+
console.warn(`Error during decompression: ${msg}`);
529+
error = new Error(`Error during decompression: ${msg}`);
530530
}
531531
}
532532
const result = {

0 commit comments

Comments
 (0)