Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于NovateException.handleException(e) 方法的调用时机的疑问 #93

Open
ygc182 opened this issue Oct 12, 2018 · 0 comments
Open

Comments

@ygc182
Copy link

ygc182 commented Oct 12, 2018

@OverRide
final public void onError(java.lang.Throwable e) {
if (e != null && e.getMessage() != null){
LogWraper.v("Novate", e.getMessage());

    } else {
        LogWraper.v("Novate", "Throwable  || Message == Null");
    }

    if(e instanceof Throwable){ // public class Throwable extends Exception   
        LogWraper.e("Novate", "--> e instanceof Throwable");
        LogWraper.e("Novate", "--> " + e.getCause().toString());
        onError((Throwable)e); // 感觉应该在这里进行  onError(NovateException.handleException(e)) 处理
    } else { // 非Exception异常
        LogWraper.e("Novate", "e !instanceof Throwable"); 
        String detail = "";
        if (e.getCause() != null) {
            detail = e.getCause().getMessage();
        }
        LogWraper.e("Novate", "--> " + detail);

// 能走到这里,说明 e 是非Exception 异常,这里不需要再去处理的吧
onError(NovateException.handleException(e));
}
onCompleted();
}

public static Throwable handleException(java.lang.Throwable e) {
// 感觉这个方法设计的初衷应该是处理 Exception 这类异常
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant