diff --git a/composer.json b/composer.json index fdd491a..b4789ed 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,10 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "ergebnis/composer-normalize": true + } }, "extra": { "branch-alias": { diff --git a/src/Client.php b/src/Client.php index 92c0afb..1951533 100644 --- a/src/Client.php +++ b/src/Client.php @@ -70,12 +70,12 @@ public function __call($name, $arguments) throw new RecvFailedException('Recv failed'); } - return with($packer->unpack($ret), function ($data) { + return with((array) $packer->unpack($ret), function ($data) use ($ret) { if (array_key_exists('result', $data)) { return $data['result']; } - throw new ServerException($data['error'] ?? []); + throw new ServerException($data['error'] ?? ['code' => 0, 'message' => 'Invalid data: ' . $ret]); }); };