fix(backend): try-catch MarkdownProcessor
Co-authored-by: Gerald Schmittinger <gerald.schmittinger@ugent.be>
This commit is contained in:
parent
90d61a6f26
commit
fd5da70d49
1 changed files with 0 additions and 5 deletions
|
@ -8,7 +8,6 @@ import { DwengoContentType } from '../content-type.js';
|
|||
import dwengoMarkedRenderer from './dwengo-marked-renderer.js';
|
||||
import { StringProcessor } from '../string-processor.js';
|
||||
import { ProcessingError } from '../processing-error.js';
|
||||
import { YAMLException } from 'js-yaml';
|
||||
|
||||
class MarkdownProcessor extends StringProcessor {
|
||||
constructor() {
|
||||
|
@ -30,10 +29,6 @@ class MarkdownProcessor extends StringProcessor {
|
|||
const html = marked(mdText, { async: false });
|
||||
return MarkdownProcessor.replaceLinks(html); // Replace html image links path
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof YAMLException) {
|
||||
throw new ProcessingError(e.message);
|
||||
}
|
||||
|
||||
throw new ProcessingError('Unknown error while processing markdown: ' + e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue