---
title: "webPlugInMainResourceDidFailWithError(_:)"
framework: Objective-C Runtime
role: symbol
role_heading: Instance Method
platforms: [macOS 10.6+]
path: "objectivec/nsobject-swift.class/webpluginmainresourcedidfailwitherror(_:)"
---

# webPlugInMainResourceDidFailWithError(_:)

Invoked when an error occurs loading the main resource.

## Declaration

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

## Parameters

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

## Discussion

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

## See Also

### Main resource messages

- [webPlugInMainResourceDidFinishLoading()](objectivec/nsobject-swift.class/webpluginmainresourcedidfinishloading().md)
- [webPlugInMainResourceDidReceive(_:)](objectivec/nsobject-swift.class/webpluginmainresourcedidreceive(_:)-5b6f6.md)
- [webPlugInMainResourceDidReceive(_:)](objectivec/nsobject-swift.class/webpluginmainresourcedidreceive(_:)-6x7b9.md)
