<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/webPlugInMainResourceDidFailWithError(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)webPlugInMainResourceDidFailWithError:"
  },
  "title" : "webPlugInMainResourceDidFailWithError(_:)"
}
-->

# webPlugInMainResourceDidFailWithError(_:)

Invoked when an error occurs loading the main resource.

```
func webPlugInMainResourceDidFailWithError(_ error: (any Error)!)
```

## Parameters

`error`

An error object containing details of why the connection failed to load the request successfully.

## Discussion

This message is invoked when the underlying `NSURLConnection` object for the main resource sends the connection:didFailWithError: message to its delegate.

---

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)