---
title: "webView(_:didFailLoadWithError:for:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webframeloaddelegate/webview(_:didfailloadwitherror:for:)"
---

# webView(_:didFailLoadWithError:for:)

Called when an error occurs loading a committed data source.

## Declaration

```swift
optional func webView(_ sender: WebView!, didFailLoadWithError error: (any Error)!, for frame: WebFrame!)
```

## Parameters

- `sender`: The web view containing the frame.
- `error`: The type of error that occurred during the load.
- `frame`: The frame being loaded.

## Discussion

Discussion This method is called after the data source has been committed but resulted in an error.
