Skip to content

Commit 2322abf

Browse files
committed
fix: dont throw thumbnail gen errors
1 parent 109e536 commit 2322abf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/api/src/modules/thumbnail/thumbnail.service.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class ThumbnailService {
9494
} catch (error: any) {
9595
file.thumbnailError = error.message;
9696
await this.em.persistAndFlush(file);
97-
throw error;
97+
return null;
9898
}
9999
}
100100

@@ -175,6 +175,10 @@ export class ThumbnailService {
175175

176176
const file = await this.fileService.getFile(fileId, request);
177177
const thumbnail = await this.createThumbnail(file);
178+
if (!thumbnail) {
179+
throw new BadRequestException("Failed to generate thumbnail.");
180+
}
181+
178182
return reply
179183
.header("X-Micro-Generated", "true")
180184
.header("X-Micro-Duration", thumbnail.duration)

0 commit comments

Comments
 (0)