fix: recover procedure editor schema errors

This commit is contained in:
lucaronin
2026-05-14 09:55:20 +02:00
parent 3fa1d34c32
commit ff4939fb29
3 changed files with 80 additions and 0 deletions

View File

@@ -47,10 +47,15 @@ function isMismatchedTransactionError(error: unknown): boolean {
return error instanceof Error && error.message.includes('Applying a mismatched transaction')
}
function isInvalidContentTransactionError(error: unknown): boolean {
return error instanceof RangeError && error.message.startsWith('Invalid content for node ')
}
export function isRecoverableEditorTransformError(error: unknown): boolean {
return error instanceof Error && (
error.name === 'TransformError'
|| isMismatchedTransactionError(error)
|| isInvalidContentTransactionError(error)
)
}