mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 14:41:29 +00:00
fix:修复安装模块时可能报异常的问题
This commit is contained in:
parent
dfc6bd75ac
commit
e5fa764873
@ -40,7 +40,7 @@ class Server
|
||||
}
|
||||
if (str_starts_with($content, '{')) {
|
||||
$json = (array)json_decode($content, true);
|
||||
throw new Exception($json['msg'], $json['code'], $json['data']);
|
||||
throw new Exception($json['msg'], $json['code'], $json['data'] ?? []);
|
||||
}
|
||||
} catch (TransferException $e) {
|
||||
throw new Exception('package download failed', 0, ['msg' => $e->getMessage()]);
|
||||
|
@ -10,7 +10,7 @@ use think\Exception as E;
|
||||
*/
|
||||
class Exception extends E
|
||||
{
|
||||
public function __construct(protected $message, protected $code = 0, protected $data = '')
|
||||
public function __construct(protected $message, protected $code = 0, protected $data = [])
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user