mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 01:20:08 +08:00
[update] support for push network error
This commit is contained in:
parent
8f85a17a1e
commit
eafad42d3f
@ -168,8 +168,8 @@ class Notice extends SingleTon
|
|||||||
'title' => '任务小黑屋',
|
'title' => '任务小黑屋',
|
||||||
'content' => "[$now_time] 用户: $uname 小黑屋: $msg"
|
'content' => "[$now_time] 用户: $uname 小黑屋: $msg"
|
||||||
],
|
],
|
||||||
'error' => [
|
'network_error' => [
|
||||||
'title' => '程序运行错误',
|
'title' => '网络异常 ',
|
||||||
'content' => "[$now_time] 用户: $uname 错误详情: $msg"
|
'content' => "[$now_time] 用户: $uname 错误详情: $msg"
|
||||||
],
|
],
|
||||||
'key_expired' => [
|
'key_expired' => [
|
||||||
|
|||||||
@ -19,6 +19,7 @@ namespace Bhp\Request;
|
|||||||
|
|
||||||
use Bhp\Cache\Cache;
|
use Bhp\Cache\Cache;
|
||||||
use Bhp\Log\Log;
|
use Bhp\Log\Log;
|
||||||
|
use Bhp\Notice\Notice;
|
||||||
use Bhp\Util\ArrayR\ArrayR;
|
use Bhp\Util\ArrayR\ArrayR;
|
||||||
use Bhp\Util\DesignPattern\SingleTon;
|
use Bhp\Util\DesignPattern\SingleTon;
|
||||||
use Bhp\Util\Exceptions\MethodNotFoundException;
|
use Bhp\Util\Exceptions\MethodNotFoundException;
|
||||||
@ -241,6 +242,7 @@ class Request extends SingleTon
|
|||||||
Log::warning("CURl -> RETRY: $retry ERROR: {$e->getMessage()} ERRNO: {$e->getCode()} STATUS: Waiting for recovery!");
|
Log::warning("CURl -> RETRY: $retry ERROR: {$e->getMessage()} ERRNO: {$e->getCode()} STATUS: Waiting for recovery!");
|
||||||
sleep(15);
|
sleep(15);
|
||||||
}
|
}
|
||||||
|
Notice::push('network_error','客户端出现网络波动或异常错误,已经尝试重试多次,但是依然无法恢复,请检查网络是否正常!');
|
||||||
failExit('网络异常,超出最大尝试次数,退出程序~');
|
failExit('网络异常,超出最大尝试次数,退出程序~');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user