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:
committed by
Linus Flood
parent
fe71348827
commit
cc34cdcf74
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user