mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-23 17:08:44 -06:00
Merge pull request #1704 from rafwell/develop
Throw exception if download media fail
This commit is contained in:
commit
4a5696eda9
@ -3521,6 +3521,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
this.logger.error('Download Media failed, trying to retry in 5 seconds...');
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
const mediaType = Object.keys(msg.message).find((key) => key.endsWith('Message'));
|
||||
if (!mediaType) throw new Error('Could not determine mediaType for fallback');
|
||||
|
||||
try {
|
||||
const media = await downloadContentFromMessage(
|
||||
{
|
||||
@ -3539,6 +3541,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
this.logger.info('Download Media with downloadContentFromMessage was successful!');
|
||||
} catch (fallbackErr) {
|
||||
this.logger.error('Download Media with downloadContentFromMessage also failed!');
|
||||
throw fallbackErr;
|
||||
}
|
||||
}
|
||||
const typeMessage = getContentType(msg.message);
|
||||
|
Loading…
Reference in New Issue
Block a user