2021-03-17 20:45:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Appwrite\GraphQL;
|
|
|
|
|
|
|
|
|
|
use GraphQL\Error\ClientAware;
|
|
|
|
|
|
2022-04-08 07:04:15 +00:00
|
|
|
class GQLExceptionDev extends \Exception implements ClientAware
|
2021-03-17 20:45:47 +00:00
|
|
|
{
|
2022-04-08 07:04:15 +00:00
|
|
|
private string $version;
|
|
|
|
|
private array $trace;
|
2021-03-17 20:45:47 +00:00
|
|
|
|
2022-04-08 07:04:15 +00:00
|
|
|
function __construct(
|
|
|
|
|
string $message = '',
|
|
|
|
|
int $code = 0,
|
|
|
|
|
string $version = '',
|
|
|
|
|
string $file = '',
|
|
|
|
|
int $line = -1,
|
|
|
|
|
array $trace = []
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
parent::__construct($message, $code);
|
2021-03-17 20:45:47 +00:00
|
|
|
$this->message = $message;
|
|
|
|
|
$this->code = $code;
|
2022-04-08 07:04:15 +00:00
|
|
|
$this->version = $version;
|
2021-03-17 20:45:47 +00:00
|
|
|
$this->file = $file;
|
|
|
|
|
$this->line = $line;
|
|
|
|
|
$this->trace = $trace;
|
|
|
|
|
}
|
2022-04-08 07:04:15 +00:00
|
|
|
|
|
|
|
|
public function isClientSafe(): bool
|
2021-03-17 20:45:47 +00:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-08 07:04:15 +00:00
|
|
|
public function getCategory(): string
|
2021-03-17 20:45:47 +00:00
|
|
|
{
|
|
|
|
|
return 'Appwrite Server Exception';
|
|
|
|
|
}
|
2022-04-08 07:04:15 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getVersion(): string
|
|
|
|
|
{
|
|
|
|
|
return $this->version;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $version
|
|
|
|
|
*/
|
|
|
|
|
public function setVersion(string $version): void
|
|
|
|
|
{
|
|
|
|
|
$this->version = $version;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-17 20:45:47 +00:00
|
|
|
}
|