CapacitorHttp error handling?

On iOS the app freezes when CapacitorHttp throws an error. try and catch does not help. In my case it happens when I call a domain that does not exist. The console then shows “NSURLErrorDomain” and the app stops there. Any ideas how I can catch and handle errors of this type?