Merged in fix/SW-2848-RTE-with-copied-divs (pull request #2173)

fix: handle when content has copied divs from episervers RTE

* fix: handle when content has copied divs from episervers RTE


Approved-by: Matilda Landström
This commit is contained in:
Joakim Jäderberg
2025-05-22 11:03:29 +00:00
committed by Linus Flood
parent fe71348827
commit cc34cdcf74
4 changed files with 48 additions and 12 deletions

View File

@@ -9,3 +9,11 @@ export async function safeTry<T>(func: Promise<T>): SafeTryResult<T> {
return [undefined, err]
}
}
export function safeTrySync<T>(func: () => T): Awaited<SafeTryResult<T>> {
try {
return [func(), undefined]
} catch (err) {
return [undefined, err]
}
}