Improved Peer Resolution and fixed minor bugs and issues, completed todo
This commit is contained in:
parent
7a39b0fd35
commit
8c2cbf48d5
5 changed files with 209 additions and 155 deletions
|
@ -6,6 +6,7 @@
|
|||
use Socialbox\Classes\Configuration;
|
||||
use Socialbox\Classes\Utilities;
|
||||
use Socialbox\Enums\StandardError;
|
||||
use Socialbox\Exceptions\RpcException;
|
||||
use Socialbox\Objects\RpcError;
|
||||
use Socialbox\Objects\RpcRequest;
|
||||
use Throwable;
|
||||
|
@ -38,4 +39,9 @@
|
|||
|
||||
return $request->produceError(StandardError::from($this->code), $this->message);
|
||||
}
|
||||
|
||||
public static function fromRpcException(RpcException $e): StandardRpcException
|
||||
{
|
||||
return new self($e->getMessage(), StandardError::tryFrom($e->getCode()) ?? StandardError::UNKNOWN, $e);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue