| 82 | | 82 | |
| 83 | return await tryReadImage(inputFile, crop); | 83 | return await tryReadImage(inputFile, crop); |
| 84 | } catch (error) { | 84 | } catch (error) { |
| 85 | console.log(`Failed to read image: ${inputFile}. Using a fallback image.`); | 85 | const message = Buffer.isBuffer(inputFile) ? 'Failed to read image buffer.' : `Failed to read image: ${inputFile}.`; |
| | 86 | console.warn(message, 'Using a fallback image.', error); |
| 86 | return await fs.promises.readFile(defaultAvatarPath); | 87 | return await fs.promises.readFile(defaultAvatarPath); |
| 87 | } | 88 | } |
| 88 | } | 89 | } |