---
title: "webView(_:didFailProvisionalNavigation:withError:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wknavigationdelegate/webview(_:didfailprovisionalnavigation:witherror:)"
---

# webView(_:didFailProvisionalNavigation:withError:)

Tells the delegate that an error occurred during the early navigation process.

## Declaration

```swift
optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: any Error)
```

## Parameters

- `webView`: The web view that called the delegate method.
- `navigation`: The navigation object for the operation. This object corresponds to a doc://com.apple.webkit/documentation/WebKit/WKNavigation object that WebKit returned when the load operation began. You use it to track the progress of that operation.
- `error`: The error that occurred.

## Mentioned in

Replacing UIWebView in your app

## See Also

### Responding to navigation errors

- [webView(_:didFail:withError:)](webkit/wknavigationdelegate/webview(_:didfail:witherror:).md)
- [webViewWebContentProcessDidTerminate(_:)](webkit/wknavigationdelegate/webviewwebcontentprocessdidterminate(_:).md)
