Fixed error when read stream cannot be created and crash server
This commit is contained in:
parent
8783af8fd0
commit
1f1831087b
1 changed files with 4 additions and 0 deletions
|
@ -146,6 +146,10 @@ export class AssetService {
|
|||
file = createReadStream(asset.resizePath);
|
||||
}
|
||||
|
||||
file.on('error', (error) => {
|
||||
Logger.log(`Cannot create read stream ${error}`);
|
||||
return new BadRequestException('Cannot Create Read Stream');
|
||||
});
|
||||
return new StreamableFile(file);
|
||||
} else if (asset.type == AssetType.VIDEO) {
|
||||
// Handle Handling Video
|
||||
|
|
Loading…
Add table
Reference in a new issue