hxb
2022-11-22 b3513b1713bb979d0a69c5a8c4ddcd038f184e6e
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);
    }
 
}