Catch iFrame API Error

I use the jitsi iframe Api to controll the jitsi-meeting.
here I have with some servers the problem that the frame-ancestors header is set.

Refused to frame '' because an ancestor violates the following Content Security Policy directive: "frame-ancestors".

For this szenario, I want to create a workaround but I need to catch this error. Is there a wayto catch it directly via the iframe API?

You cannot work this around, you need to reconfigure your server’s CSP configuration / headers.