zoukankan      html  css  js  c++  java
  • Fundebug微信小程序错误监控插件更新至1.1.0,新增test()与notifyHttpError()方法

    摘要: 1.1.0新增fundebug.test()fundebug.notifyHttpError()方法,同时大小压缩至15K

    Fundebug是专业的小程序BUG监控服务,可以第一时间为您捕获生存环境中小程序的异常、错误或者BUG,及时给开发者发送报警,帮助您快速修复BUG。欢迎大家免费试用,也欢迎各位用户反馈建议或者问题。

    test(name, message)

    使用 fundebug.test()方法可以用于测试 Fundebug 插件。

    name: 错误名称,参数类型为字符串,默认值为"Test"

    message: 错误信息,参数类型为字符串,默认值为"Hello, Fundebug!"

    示例 1 : 没有参数

    fundebug.test();
    

    示例 2 : 带参数

    fundebug.test("Hello", "This is a Test");
    

    fundebug.test() 主要用于测试,它发送的错误每次都会报警邮件(每天的限额是 20 封),这样可能会给您造成困扰。为了避免重复报警,请使用其他 API 记录错误,这样同一个错误将只会在错误数达到阈值(10, 100, 100...)的时候报警。

    notifyHttpError(req, res, option)

    使用 notifyHttpError,可以将 HTTP 请求错误发送到 Fundebug。

    req: HTTP 请求参数,参数类型为 Object,其子属性与wx.request的请求参数一致,如下:

    • method
    • url
    • data
    • header
    • dataType
    • responseType

    res: HTTP 返回参数,参数类型为 Object,其子属性与wx.request的返回参数一致,如下:

    • statusCode
    • errMsg
    • data
    • header

    option: 可选对象,参数类型为 Object,用于发送一些额外信息,比如:

    • metaData: 其他自定义信息

    示例:

    wx.request({
        method: "POST",
        url: "https://example.com/create",
        data: {
            test: "test"
        },
        success(res) {
            fundebug.notifyHttpError(
                {
                    method: "POST",
                    url: "https://example.com/create"
                },
                res
            );
        },
        fail(res) {
            fundebug.notifyHttpError(
                {
                    method: "POST",
                    url: "https://example.com/create"
                },
                res
            );
        }
    });
    

    最后,感谢 Fundebug 用户无事忙的反馈。

    参考

    关于Fundebug

    Fundebug专注于JavaScript、微信小程序、微信小游戏、支付宝小程序、React Native、Node.js和Java线上应用实时BUG监控。 自从2016年双十一正式上线,Fundebug累计处理了10亿+错误事件,付费客户有Google、360、金山软件、百姓网等众多品牌企业。欢迎大家免费试用

    版权声明

    转载时请注明作者Fundebug以及本文地址:
    https://blog.fundebug.com/2019/04/19/fundebug-wechat-miniprogram-1-1-0/

  • 相关阅读:
    python中__dict__和dir()
    python学习之copy模块
    python学习之optparse
    python join和split和strip用法
    浅谈 Python 的 with 语句
    Python:itertools模块
    OpenStack Swift client开发
    OpenStack Swift集群部署流程与简单使用
    python bisect模块
    Python中的导入
  • 原文地址:https://www.cnblogs.com/fundebug/p/fundebug-wechat-miniprogram-1-1-0.html
Copyright © 2011-2022 走看看