---
title: "webView(_:resource:didFailLoadingWithError:from:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webresourceloaddelegate/webview(_:resource:didfailloadingwitherror:from:)"
---

# webView(_:resource:didFailLoadingWithError:from:)

Invoked when a resource failed to load.

## Declaration

```swift
optional func webView(_ sender: WebView!, resource identifier: Any!, didFailLoadingWithError error: (any Error)!, from dataSource: WebDataSource!)
```

## Parameters

- `sender`: The web view that sent this message.
- `identifier`: An identifier object used to track the resource being loaded by dataSource.
- `error`: The error that occurred loading that resource.
- `dataSource`: The data source for this web view.

## Discussion

Discussion Delegates might implement this method to display or log a detailed error message.

## See Also

### Loading Content

- [webView(_:resource:willSend:redirectResponse:from:)](webkit/webresourceloaddelegate/webview(_:resource:willsend:redirectresponse:from:).md)
- [webView(_:resource:didFinishLoadingFrom:)](webkit/webresourceloaddelegate/webview(_:resource:didfinishloadingfrom:).md)
- [webView(_:resource:didReceive:from:)](webkit/webresourceloaddelegate/webview(_:resource:didreceive:from:)-22bdg.md)
- [webView(_:resource:didReceiveContentLength:from:)](webkit/webresourceloaddelegate/webview(_:resource:didreceivecontentlength:from:).md)
- [webView(_:plugInFailedWithError:dataSource:)](webkit/webresourceloaddelegate/webview(_:pluginfailedwitherror:datasource:).md)
