wxr
2022-11-23 1e7b3abd15d37f6c6bc97ac14922457b9604c275
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.mm.android.deviceaddmodule.mobilecommon.businesstip;
 
import android.os.Message;
import android.text.TextUtils;
 
import com.mm.android.deviceaddmodule.mobilecommon.AppConsume.BusinessException;
 
public class BusinessErrorTip {
 
    public static String getErrorTip(Message message) {
        String errorDesc = "";
 
        if (message.obj != null && message.obj instanceof BusinessException) {
            BusinessException exception = (BusinessException)message.obj;
            if (!TextUtils.isEmpty(exception.errorDescription)) {
                errorDesc = exception.errorDescription;
            }
        }
 
        return errorDesc;
    }
 
    public static Throwable throwError(Message message) {
        BusinessException exception=new BusinessException();
        if (message.obj != null && message.obj instanceof BusinessException) {
             exception = (BusinessException)message.obj;
        }
        return new Throwable(exception.errorDescription);
    }
 
}