catch text parsing error
This commit is contained in:
parent
2398aab82b
commit
4181bee43c
|
@ -92,7 +92,13 @@ export async function importPosts(
|
||||||
logger.info(`Is dm, skip [${linenum}] ...`);
|
logger.info(`Is dm, skip [${linenum}] ...`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const text = htmlToMfm(post.content, post.tag);
|
let text;
|
||||||
|
try {
|
||||||
|
text = htmlToMfm(post.content, post.tag);
|
||||||
|
} catch (e) {
|
||||||
|
logger.warn(`Error while parsing text in line ${linenum}: ${e}`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
logger.info(`Posting[${linenum}] ...`);
|
logger.info(`Posting[${linenum}] ...`);
|
||||||
|
|
||||||
const note = await create(user, {
|
const note = await create(user, {
|
||||||
|
|
Loading…
Reference in New Issue