[5.2.8]
[shuttle_p] [网络接口失败添加错误处理]
This commit is contained in:
@@ -14,5 +14,8 @@ public interface OchCommonServiceCallback< T > {
|
|||||||
|
|
||||||
default void onError() {
|
default void onError() {
|
||||||
|
|
||||||
|
}
|
||||||
|
default void onError(String msg) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
|||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
super.onError(e)
|
super.onError(e)
|
||||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() ${e.message}")
|
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() ${e.message}")
|
||||||
callback?.onError()
|
callback?.onError("$apiName: onError() ${e.message}")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(message: String, code: Int) {
|
override fun onError(message: String, code: Int) {
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ object TicketModel : StateChangeListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError() {
|
override fun onError(message: String) {
|
||||||
super.onError()
|
ScannerChainLogManager.writeChainLog(TAG +"onError","/och-vehicle/api/scanner/device/writeOff接口请求错误orderNo:${orderNo}__uid:${uid}__reaseon:${message}")
|
||||||
ScannerChainLogManager.writeChainLog(TAG +"onError","接口请求错误orderNo:${orderNo}__uid:${uid}")
|
sendMessage2Driver("网络错误")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ object PassengerServiceManager {
|
|||||||
ticketInfo
|
ticketInfo
|
||||||
)
|
)
|
||||||
.transformTry()
|
.transformTry()
|
||||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverOperationStatus"))
|
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOff"))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user