Skip to content

Commit

Permalink
fix: minor logging adjustments for streaming bucket(-file)s
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jul 2, 2024
1 parent a0b59ea commit 76f4c18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function executeBucketFileRouteStreamHandler(req: Request, res: Res
useLogger().debug(`Streamed file ${entity.hash} (${id}) of ${bucketName}`);
});
stream.on('error', (err) => {
useLogger().debug(err);
useLogger().error(err);
});
stream.pipe(res);
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ export async function executeBucketRouteStreamHandler(req: Request, res: Respons

useLogger().debug(`Streaming files of ${bucketName}`);

await streamFiles(res, bucketName, files);
try {
await streamFiles(res, bucketName, files);

useLogger().debug(`Streamed files of ${bucketName}`);
useLogger().debug(`Streamed files of ${bucketName}`);
} catch (err) {
useLogger().error(err);
}
}

0 comments on commit 76f4c18

Please sign in to comment.