refactor: normalize error logging (#7370)

This commit is contained in:
Joshua Chen 2022-05-08 13:40:34 +08:00 committed by GitHub
parent 87c7639a52
commit 7c9892888d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 27 additions and 30 deletions

View file

@ -18,6 +18,7 @@ import type {
BlogPost,
} from '@docusaurus/plugin-content-blog';
import {blogPostContainerID} from '@docusaurus/utils-common';
import logger from '@docusaurus/logger';
async function generateBlogFeed({
blogPosts,
@ -127,7 +128,8 @@ async function createBlogFeedFile({
try {
await fs.outputFile(path.join(generatePath, feedPath), feedContent);
} catch (err) {
throw new Error(`Generating ${feedType} feed failed: ${err}.`);
logger.error(`Generating ${feedType} feed failed.`);
throw err;
}
}