---
title: "webView(_:plugInFailedWithError:dataSource:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webresourceloaddelegate/webview(_:pluginfailedwitherror:datasource:)"
---

# webView(_:plugInFailedWithError:dataSource:)

Invoked when a plug-in fails to load.

## Declaration

```swift
optional func webView(_ sender: WebView!, plugInFailedWithError error: (any Error)!, dataSource: WebDataSource!)
```

## Parameters

- `sender`: The web view that sent this message.
- `error`: The error that occurred during the process of loading that resource. The userInfo dictionary of error may contain additional information about the failure. If the userInfo dictionary is not nil, it may contain some or all of these key-value pairs. The value of the NSErrorFailingURLKey key is a URL string of the SRC attribute. The value of the doc://com.apple.webkit/documentation/WebKit/WebKitErrorPlugInNameKey key is a string containing the plug-in’s name. The value for the doc://com.apple.webkit/documentation/WebKit/WebKitErrorPlugInPageURLStringKey key is a URL string of the PLUGINSPAGE attribute. The value of the doc://com.apple.webkit/documentation/WebKit/WebKitErrorMIMETypeKey key is a string of the TYPE attribute.
- `dataSource`: The data source for this web view.

## Discussion

Discussion This method might be invoked if a plug-in is not found, fails to load, or is not available for some reason. Delegates might implement this method to display or log a detailed error message. If you do not implement this method, no action is taken.

## 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(_:resource:didFailLoadingWithError:from:)](webkit/webresourceloaddelegate/webview(_:resource:didfailloadingwitherror:from:).md)
