{"id":17967466,"url":"https://github.com/msidolphin/vue-execption-reporter","last_synced_at":"2026-04-11T21:44:27.408Z","repository":{"id":44972536,"uuid":"236142242","full_name":"msidolphin/vue-execption-reporter","owner":"msidolphin","description":"An exception reporting libarary","archived":false,"fork":false,"pushed_at":"2022-01-15T06:00:21.000Z","size":493,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T12:53:57.475Z","etag":null,"topics":["error-reporting","exception-handler","exception-reporting","vue"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msidolphin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-25T08:03:28.000Z","updated_at":"2020-01-25T13:24:20.000Z","dependencies_parsed_at":"2022-09-05T13:01:59.595Z","dependency_job_id":null,"html_url":"https://github.com/msidolphin/vue-execption-reporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/msidolphin/vue-execption-reporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Fvue-execption-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Fvue-execption-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Fvue-execption-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Fvue-execption-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msidolphin","download_url":"https://codeload.github.com/msidolphin/vue-execption-reporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Fvue-execption-reporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265696723,"owners_count":23812832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-reporting","exception-handler","exception-reporting","vue"],"created_at":"2024-10-29T14:08:55.089Z","updated_at":"2026-04-11T21:44:22.371Z","avatar_url":"https://github.com/msidolphin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-exception-reporter\n\n\u003e An exception reporting libarary\n\n![Build Status](https://travis-ci.org/msidolphin/vue-execption-reporter.svg?branch=master)\n![Node CI](https://github.com/msidolphin/vue-execption-reporter/workflows/Node%20CI/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/msidolphin/vue-execption-reporter/badge.svg?branch=master)](https://coveralls.io/github/msidolphin/vue-execption-reporter?branch=master)\n[![codebeat badge](https://codebeat.co/badges/9bb698c9-22d9-467b-be7e-882b71586df3)](https://codebeat.co/projects/github-com-msidolphin-vue-execption-reporter-master)\n\n# 使用方式\n```js\nimport Vue from 'vue'\nimport App from './App'\nimport VueExceptionReporter, { clearRepeatScanner } from 'vue-exception-reporter'\n\nVue.use(VueExceptionReporter, {\n  reportUrl: 'http://localhost:7001/api/v1/exception/collect'\n})\n\nnew Vue({\n  el: '#app',\n  components: { App },\n  template: '\u003cApp/\u003e',\n  beforeDestroy () {\n    // clearRepeatScanner()\n    // VueExceptionReporter.clearRepeatScanner()\n  }\n})\n```\n\n# 配置选项\n```js\n{\n  reportUrl: '', // 上报地址，类型可以是字符串或函数。如果类型为函数，那么应该返回字符串\n  enable: true, // 是否启用\n  debug: true, // 是否在控制台打印错误日志\n  ignoreRepeatTimes: 5, // 在指定时间内异常重复触发超过该次数时不进行上报\n  scanInterval: 3000, // 扫描重复次数间隔\n  usingBeacon: false, // 是否采用beacon上报数据，默认采用Image标签\n  beforeReport: undefined, // 上报数据前的钩子函数 (data, type, event) =\u003e {} 注意：如果异常对象被置为空，则不会进行上报\n  afterReport: undefined, // 数据上报后的钩子函数\n  send: undefined, // 用户自定义上报函数 (url, data) =\u003e {}\n  installed: undefined, // 插件成功安装钩子函数\n  reportUnchangeException: true, // 是否上报未捕获异常\n  reportRequestException: true, // 是否上报ajax请求异常\n  reportUnhandleRejection: true, // 是否上报未处理的reject异常（兼容性不好）\n  reportFailedToLoadResourceException: true, // 是否上报资源加载失败异常\n  typeDefine: { // 类型常量定义，因为上传时的数据类型\n    RESOURCE_LOAD_FAILED_EXCEPTION: 'ResourceLoadFailedException', // 资源加载失败异常\n    REQUEST_FAILED_EXCEPTION: 'RequestFailedException', // ajax请求异常\n    SCRIPT_RUNTIME_EXCEPTION: 'ScriptRuntimeException', // js脚本执行错误异常\n    UNHANDLE_REJECTION_EXCEPTION: 'UnhandleRejectionException' // 未处理reject异常\n  }\n}\n```\n\n# 异常对象结构\n\n## 基础结构\n\n| 参数名称   | 说明   | 类型   | \n| :---- |:---- |:---- |\n| id   | 上报数据唯一标识   | String   | \n| uid   | 浏览器用户唯一标识   | String   | \n| type   | 异常类型（由配置项中typeDefined定义）| String   | \n| timestamp | 时间戳（异常对象创建时间）| Number  | \n| message | 异常消息  | Number   |\n| ua | 用户代理  | String   | \n| url | 异常发生页面  | String   |\n| osName | 操作系统  | String   | \n| osVersion | 操作系统版本  | String   | \n| browserName | 浏览器  | String   | \n| browserVersion | 浏览器版本  | String   | \n| engineName | 浏览器渲染引擎  | String   | \n| engineVersion | 浏览器渲染引擎版本  | String   | \n| deviceName | 设备名称  | String   | \n| deviceType | 设备类型  | String   | \n| deviceVendor | 设备供应商  | String   | \n| jsExceptionName | js异常类型 | String   | \n| stack | 异常堆栈 | Array  | \n| meta | 异常明细项  | Object   | \n\n\n## 明细项\n\n### js脚本执行错误异常\n\n| 参数名称   | 说明   | 类型  |\n|:---- |:---- |:---- |\n| type   | 错误类型   | String | \n| element   | 触发元素   | String| \n| elementInnerText   | 触发元素文本 | String| \n| elementClassName | 触发元素类名| String| \n\n\n### ajax请求异常\n\n| 参数名称   | 说明   | 类型   | \n|:----|:----|:----|\n| status   | 状态码   | Number   | \n| requestUrl   | 请求地址   | String   | \n| requestMethod   | 请求方式 | String   | \n| requestBody | 请求体（json） | String  | \n\n### 资源加载失败异常\n\n| 参数名称   | 说明   | 类型   | \n|:----|:----|:----|\n| type   | 资源类型   | Number   | \n| src    | 资源地址   | String   | \n| html   | html标签 | String   | \n\n\n### 未处理reject异常\n\n| 参数名称   | 说明   | 类型   | \n|:----|:----|:----|\n| reason   | reject原因 （如果reason为异常类型则会忽略）  | -   | \n\n\n\n# License\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright © 2019, msidolphin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsidolphin%2Fvue-execption-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsidolphin%2Fvue-execption-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsidolphin%2Fvue-execption-reporter/lists"}