Comments (17)
不太清楚你想要什么效果,一般throw就行,如果是错误过滤,有filter参数
from flutter_bugly.
就是上传指定的字符串,比如网络请求错误,把这条请求的路径参数和返回的状态码上传到bugly
from flutter_bugly.
试试putUserData方法
from flutter_bugly.
@crazecoder putUserData已经用过啦,用来标识的,我现在想自定义上传错误,这个putUserData不能再用了哦
from flutter_bugly.
目前是抓取flutter的异常,利用bugly提供的单独上报方法去做的,单独根据某个异常去上报不太好做,现在能想到的解决方法,就是手动去catch对应异常,然后throw一个带map的自定义Exception,但是总觉得不是太合适,不知道你有没有更好的想法
from flutter_bugly.
try{
throw "123";
}catch(e){
throw CustomException(message:e.toString(),map: {"test": "ceshi"});
}
使用方法类似这样,代码还没上传
from flutter_bugly.
flutter我也是刚学,您参考一下sentry,国外的,github有flutter版本,看看是怎么做的,这是我接入后的效果
from flutter_bugly.
try{ throw "123"; }catch(e){ throw CustomException(message:e.toString(),map: {"test": "ceshi"}); }
使用方法类似这样,代码还没上传
如果这样写,程序进了catch里面,不会崩溃吗?据我了解好像会吧,我现在是只想上传网络请求的报错,不影响程序运行哦
from flutter_bugly.
异步里是不会影响程序的,还是封装一下吧,类似这种
try {
throw "123";
} catch (e) {
FlutterBugly.throwException(message: e.toString(), data: {"test": "ceshi"});
}
如果没有其他好的方法,只能这样了
from flutter_bugly.
flutter我也是刚学,您参考一下sentry,国外的,github有flutter版本,看看是怎么做的,这是我接入后的效果
这个是我线上项目的日志,个人觉得还是需要去自定义exception,毕竟框架也不知道返回json的格式
from flutter_bugly.
FlutterBugly
噢噢 目前FlutterBugly.throwException(message: e.toString(), data: {"test": "ceshi"});这样写还没上传对吧
from flutter_bugly.
能否再简洁一点,还需要写个try catch
from flutter_bugly.
用FlutterBugly封装一下try throw catch?
from flutter_bugly.
static var sentry = SentryClient(dsn: "https://[email protected]/1729182");
sentry.captureException(exception: "接口报错==>${e.response.request.path},状态码:${e.response.statusCode},${e.response.data['Message']}");
类似这样使用
from flutter_bugly.
try catch 只是为了调试,实际情况,在遇到异常的时候直接throwException就可以了,例如dio里使用
await _dio.get<Map>(url).catchError((_error) {
if (CancelToken.isCancel(_error)) {
debugLog('Request canceled! ' + _error.message);
} else {
FlutterBugly.throwException(message: _error.toString(), data: {"test": "ceshi"});
}
return null;
});
代码已提交到beta分支,你可以引用beta分支试试
from flutter_bugly.
d3d1ab9
把直接上报方法开放出来了,你或者可以直接用upload
from flutter_bugly.
你可以的,完美!😄
from flutter_bugly.
Related Issues (20)
- 不同的渠道,可以下载到对应的apk吗
- 上传升级包versionCode为1,上传flutter后获取的versionCode为1001,求解
- 隐私权限问题 HOT 8
- 激活量如何增加?
- 试了各种办法,后台都没有正常捕获到异常,而且也没有装机量,启动次数的统计 HOT 4
- FlutterBugly.uploadException可以支持传自定义title异常标题吗,这个非常重要,拜托crazecoder一定要抽空加上,不然在bugly高级搜索里不好配合搜索出指定异常
- 获取更新信息后,信息不全,title,version没有了? HOT 6
- 求助-调用FlutterBugly.checkUpgrade()检查更新的时候报错直接闪退
- 这是腾讯的官方插件吗? HOT 3
- 这些warning 未分析的数据是什么?能闭掉?Warning: Unparsed data ",N,Gjce_enable,SsetJce_enable:,Vjcev2_p_0_r_enable" in attribute string "TB,N,Gjce_enable,SsetJce_enable:,Vjcev2_p_0_r_enable" for property jcev2_p_0_r_enable Warning: Unparsed data ",N,Gjce_enableUserInfo,SsetJce_enableUserInfo:,Vjcev2_p_1_r_enableUserInfo" in attribute string "TB,N,Gjce_enableUserInfo,SsetJce_enableUserInfo:,
- bugly 2.5.92版本库iOS原生运行不了,缺少相关库
- flutter_bugly_play:No podspec found for `flutter_bugly_play`
- android 12 设备点击升级无响应
- Buyly调用两次report的原因是什么?
- 更新策略不稳定:时有时无,策略不是最新的
- ios.bugly.qq.com exists SSL error
- debug模式下,能否设置isDebugger HOT 2
- Zone mismatch. HOT 3
- Flutter集成IOS编译报错问题 HOT 1
- 不更新了吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_bugly.