• Stars
    star
    164
  • Rank 230,032 (Top 5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🗑 Error Handle Of Rxjava

RxErrorHandler

Jcenter Build Status API License Author QQ-Group

Error Handle Of Rxjava

Download

implementation 'me.jessyan:rxerrorhandler:2.1.1' //rxjava2

implementation 'me.jessyan:rxerrorhandler:1.0.1' //rxjava1

Initialization

  RxErrorHandler rxErrorHandler = RxErrorHandler 
                .builder()
                .with(this)
                .responseErrorListener(new ResponseErrorListener() {
                    @Override
                    public void handleResponseError(Context context, Throwable t) {
                        if (t instanceof UnknownHostException) {
                            //do something ...
                        } else if (t instanceof SocketTimeoutException) {
                            //do something ...
                        } else {
                            //handle other Exception ...
                        }
                        Log.w(TAG, "Error handle");
                    }
                }).build();

Usage

  Observable
            .error(new Exception("Error"))
            .retryWhen(new RetryWithDelay(3, 2))//retry(http connect timeout) 
            .subscribe(new ErrorHandleSubscriber<Object>(rxErrorHandler) {
                    @Override
                    public void onNext(Object o) {

                    }

                });

  //Backpressure
  Flowable
          .error(new Exception("Error"))
          .retryWhen(new RetryWithDelayOfFlowable(3, 2))//retry(http connect timeout)
          .subscribe(new ErrorHandleSubscriberOfFlowable<Object>(rxErrorHandler) {
                   @Override
               public void onNext(Object o) {

                  }
               });

About Me

License

 Copyright 2016, jessyan               
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at   

       http://www.apache.org/licenses/LICENSE-2.0  

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License. 

More Repositories

1

AndroidAutoSize

🔥 A low-cost Android screen adaptation solution (今日头条屏幕适配方案终极版,一个极低成本的 Android 屏幕适配方案).
Java
13,018
star
2

MVPArms

⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架).
Java
10,269
star
3

ProgressManager

⏳ Listen the progress of downloading and uploading in Okhttp, compatible Retrofit and Glide (一行代码即可监听 App 中所有网络链接的上传以及下载进度, 包括 Glide 的图片加载进度).
Java
2,612
star
4

RetrofitUrlManager

🔮 Let Retrofit support multiple baseUrl and can be change the baseUrl at runtime (以最简洁的 Api 让 Retrofit 同时支持多个 BaseUrl 以及动态改变 BaseUrl).
Java
2,114
star
5

ArmsComponent

📦 A complete android componentization solution, powered by MVPArms (MVPArms 官方快速组件化方案).
Java
1,691
star
6

MVPArt

🎨 A new Android MVP architecture (此框架旨在解决传统 MVP 类和接口太多, 并且 Presenter 和 View 通过接口通信过于繁琐, 重用 Presenter 代价太大等问题).
Java
782
star
7

InsGallery

📸 Instagram-like image picker for Android (一款 UI 炫酷高仿 Instagram 的图片、视频选择器)
Java
636
star
8

ArmsComponent-Template

🛠️ 一键搭建 ArmsComponent 快速组件化方案的整体组件架构, 让新手也可以一秒开始组件化项目, 开发神器, 让您一秒起飞, 体验纯傻瓜式的组件化开发, 避免组件化从入门到放弃!
FreeMarker
345
star
9

MVPArms-Module-Template

🛠 一键搭建 MVPArms 的官方架构, 让新手一秒即可开启 MVPArms 的世界, 免于项目繁琐配置的烦恼
FreeMarker
244
star
10

LifecycleModel

📬 The LifecycleModel class is designed to store and manage UI-related data in a lifecycle conscious way, the LifecycleModel class allows data to survive configuration changes such as screen rotations, it also handles the communication of the Activity / Fragment with the rest of the application, base on https://developer.android.google.cn/topic/libraries/architecture/viewmodel.html
Java
229
star
11

CameraFilters

📷 摄像头实时滤镜处理库,自带10多种滤镜,支持滤镜扩展,并且兼容七牛云直播滤镜处理
Java
187
star
12

MobileSafe

🛡 下载过三万并且非常适合初学者学习的一个项目(没错就是黑马手机卫士)
Java
159
star
13

WideEyes

👁️ 源于{开眼视频},架构使用Mvp+Dagger2+Retrofit+Rxjava的一款内外兼得的学习项目
Java
70
star
14

AudioManagerSDK

智播项目(应用场景)专门用于处理录音逻辑的SDK
Java
56
star
15

RaiseManagerSDK

智播项目,教育类应用场景之举手发言
12
star
16

JessYanCoding

3
star