<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebResourceLoadDelegate/webView(_:resource:didFailLoadingWithError:from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WebResourceLoadDelegate(im)webView:resource:didFailLoadingWithError:fromDataSource:"
  },
  "title" : "webView(_:resource:didFailLoadingWithError:from:)"
}
-->

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

Invoked when a resource failed to load.

```
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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)