| 1 | <?php |
||
| 19 | final class RequestFailed extends \RuntimeException implements ClientException |
||
| 20 | { |
||
| 21 | public static function fromErrorResponse(Response $response) : self |
||
| 22 | { |
||
| 23 | return new self( |
||
| 24 | $response->getBodyField(IProto::ERROR), |
||
| 25 | $response->getHeaderField(IProto::CODE) & (Response::TYPE_ERROR - 1) |
||
| 26 | ); |
||
| 27 | } |
||
| 28 | |||
| 29 | public static function unknownSpace(string $spaceName) : self |
||
| 30 | { |
||
| 31 | return new self(\sprintf("Space '%s' does not exist", $spaceName)); |
||
| 32 | } |
||
| 33 | |||
| 34 | public static function unknownIndex(string $indexName, int $spaceId) : self |
||
| 42 | } |
||
| 43 |