Java Code Examples for com.tencent.bugly.crashreport.CrashReport#postCatchedException()

The following examples show how to use com.tencent.bugly.crashreport.CrashReport#postCatchedException() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CaptureService.java    From CapturePacket with MIT License 6 votes vote down vote up
@Override
public void run() {
    try {
        mProxyServer = new BrowserMobProxyServer(mKeyStoreDir);
        mProxyServer.setTrustAllServers(true);
        mProxyServer.start(PROXY_PORT);

        mProxyServer.enableHarCaptureTypes(CaptureType.REQUEST_HEADERS, CaptureType.REQUEST_COOKIES,
                CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_HEADERS, CaptureType.REQUEST_COOKIES,
                CaptureType.RESPONSE_CONTENT);

        String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA)
                .format(new Date(System.currentTimeMillis()));
        mProxyServer.newHar(time);
        mProxyState = STATE_SUCCESS;

    }catch (Throwable e){
        CrashReport.postCatchedException(e);
        mProxyState = STATE_FAIL;
    }
    if (mCaptureBinder != null) {
        mCaptureBinder.setProxyServer(mProxyServer);
        mCaptureBinder.setProxyState(mProxyState);
    }

}
 
Example 2
Source File: Config.java    From V2EX with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 初始化配置, 从 SharedPreferences 文件中读取配置
 * @param context the context
 */
public static void init(Context context){

    if (mConfig == null){
        mConfig = context.getResources().getConfiguration();
    }
    try {
        loadConfig(context);
    }catch (Exception e){
        e.printStackTrace();
        CrashReport.postCatchedException(e);
    }
    setNightTheme();
    restoreAccount();
}
 
Example 3
Source File: RxObserver2.java    From V2EX with GNU General Public License v3.0 5 votes vote down vote up
@CallSuper
@Override
public void onError(Throwable e) {
    e.printStackTrace();
    CrashReport.postCatchedException(e);
    if (isViewReady()){
        mResponseListener.onFailed(e.getMessage());
        mResponsibleView.onFailMsg(e.getMessage());
    }
}
 
Example 4
Source File: RxObserver.java    From V2EX with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 在这里处理请求层次的错误,例如网络错误,服务器错误等
 *
 * @param e 异常
 */
@Override
public void onError(Throwable e) {
    e.printStackTrace();
    _onError(e.getMessage());
    CrashReport.postCatchedException(e);
}
 
Example 5
Source File: BaseAppCompatActivity.java    From fuckView with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void startActivity(Intent intent, @Nullable Bundle options) {
    try {
        super.startActivity(intent, options);
    } catch (ActivityNotFoundException e) {
        CrashReport.postCatchedException(e);
    }
}
 
Example 6
Source File: MainActivity.java    From AndroidHttpCapture with MIT License 5 votes vote down vote up
@Override
public void onError(Context context, UploadInfo uploadInfo, ServerResponse serverResponse, Exception exception) {
    dismissLoading();
    Snackbar.make(rootView, "上传失败!", Snackbar.LENGTH_LONG).setAction("Action", null).show();
    exception.printStackTrace();
    CrashReport.postCatchedException(exception);
}
 
Example 7
Source File: BuglyHelper.java    From GeometricWeather with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void report(Exception e) {
    CrashReport.postCatchedException(e);
}
 
Example 8
Source File: CrashReportHelper.java    From Mysplash with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void report(Throwable t) {
    CrashReport.postCatchedException(t);
}