• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Class (WebResourceError)
2
3Implements the **WebResourceError** object to manage resource errors. For details about the sample code, see [onErrorReceive](./arkts-basic-components-web-events.md#onerrorreceive).
4
5> **NOTE**
6>
7> - The initial APIs of this component are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
8>
9> - The initial APIs of this class are supported since API version 8.
10>
11> - You can preview how this component looks on a real device, but not in DevEco Studio Previewer.
12
13## constructor
14
15constructor()
16
17Constructs a **WebResourceError** object.
18
19**System capability**: SystemCapability.Web.Webview.Core
20
21## getErrorCode
22
23getErrorCode(): number
24
25Obtains the error code for resource loading.
26
27**System capability**: SystemCapability.Web.Webview.Core
28
29**Return value**
30
31| Type    | Description         |
32| ------ | ----------- |
33| number | Error code for resource loading. For details about error codes, see [WebNetErrorList](arkts-apis-netErrorList.md).|
34
35## getErrorInfo
36
37getErrorInfo(): string
38
39Obtains error information about resource loading.
40
41**System capability**: SystemCapability.Web.Webview.Core
42
43**Return value**
44
45| Type    | Description          |
46| ------ | ------------ |
47| string | Error information about resource loading.|
48