Skip to content

错误事件

事件名称

onError

返回示例

js
onError(e) {
  console.log(e.detail)
}

回调示例

json
{
  "response": {
    "statusCode": 403,
    "encoding": "utf-8",
    "reasonPhrase": "Forbidden",
    "mimeType": "text/plain",
    "responseHeaders": {
      "Content-Type": "text/plain; charset=utf-8",
      "Date": "Sun, 15 Sep 2024 05:22:55 GMT",
      "Content-Length": "0",
      "Server": "bfe",
      "X-Bfe-Svbbrers": "MTExLjE3NS4xMTkuMTYw,1.0"
    }
  },
  "request": {
    "isForMainFrame": false,
    "hasGesture": false,
    "method": "GET",
    "requestHeaders": {
      "Referer": "https://www.baidu.com/",
      "Accept": "*/*",
      "User-Agent": "Mozilla/5.0 (Linux; Android 12; EBG-AN00 Build/HUAWEIEBG-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.88 Mobile Safari/537.36"
    },
    "isRedirect": false
  }
}

回调说明

参数名参数类型参数描述
messageString消息提示
codeInteger返回类型,0.成功,其他:失败