Import reports
ImportReport describes accepted changes, warnings and unsupported formatting. ContentImportError signals a rejected import; allowLossy confirms supported cleanup/formatting loss but does not disable sanitization. The interface explains a localized reason rather than raw internal tags.
CSS and source
CSSValidationError rejects the whole stylesheet/application pair. Incorrect tag nesting or fenced Markdown blocks preserve the last valid document and block mode switching. Fix or reset the source draft. Getters continue to return the applied version.
Async operations
StaleDocumentError protects delayed edits/uploads against newer revisions. AbortError reports cancellation. Loading failures usually mean a missing/stale source.js/codecs.js or chunk; deploy the full matching distribution. Await readiness and catch rejected operations.
Cleanup
Invalid configurations and duplicate/unavailable plugins throw. A destroy cleanup failure may produce AggregateError after resources have been released. Present useful recovery in your application instead of discarding content. Troubleshooting, security.
import { ContentImportError } from '@vitext-ru/editor';
try {
await editor.setContent(incomingHTML);
} catch (error) {
if (error instanceof ContentImportError) {
console.log(error.report.warnings);
// await editor.setContent(incomingHTML, { allowLossy: true });
} else throw error;
}