[update] support for push network error

This commit is contained in:
Lkeme 2023-10-29 20:47:22 +08:00
parent 8f85a17a1e
commit eafad42d3f
2 changed files with 4 additions and 2 deletions

View File

@ -168,8 +168,8 @@ class Notice extends SingleTon
'title' => '任务小黑屋',
'content' => "[$now_time] 用户: $uname 小黑屋: $msg"
],
'error' => [
'title' => '程序运行错误',
'network_error' => [
'title' => '网络异常 ',
'content' => "[$now_time] 用户: $uname 错误详情: $msg"
],
'key_expired' => [

View File

@ -19,6 +19,7 @@ namespace Bhp\Request;
use Bhp\Cache\Cache;
use Bhp\Log\Log;
use Bhp\Notice\Notice;
use Bhp\Util\ArrayR\ArrayR;
use Bhp\Util\DesignPattern\SingleTon;
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!");
sleep(15);
}
Notice::push('network_error','客户端出现网络波动或异常错误,已经尝试重试多次,但是依然无法恢复,请检查网络是否正常!');
failExit('网络异常,超出最大尝试次数,退出程序~');
}