Fix error log

999da4945aaf1da6f6d4ff1e9e314c11f0ccfeb1

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Showing whitespace changes
src/endpoints/characters.js+2 -1
@@ -82,7 +82,8 @@ async function writeCharacterData(inputFile, data, outputFile, request, crop = u
8282
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 }