2018-09-03 22:43:02 +03:00
|
|
|
<?php
|
|
|
|
|
2018-09-03 23:46:14 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-09-03 23:12:03 +03:00
|
|
|
namespace GraphQL\Tests\Server;
|
|
|
|
|
2018-09-26 12:07:23 +03:00
|
|
|
use Exception;
|
2018-09-03 22:43:02 +03:00
|
|
|
use GraphQL\Error\ClientAware;
|
|
|
|
|
2018-09-26 12:07:23 +03:00
|
|
|
class Unsafe extends Exception implements ClientAware
|
2018-09-03 22:43:02 +03:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns true when exception message is safe to be displayed to a client.
|
|
|
|
*
|
|
|
|
* @return bool
|
2018-09-26 12:07:23 +03:00
|
|
|
*
|
|
|
|
* @api
|
2018-09-03 22:43:02 +03:00
|
|
|
*/
|
|
|
|
public function isClientSafe()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns string describing a category of the error.
|
|
|
|
*
|
|
|
|
* Value "graphql" is reserved for errors produced by query parsing or validation, do not use it.
|
|
|
|
*
|
|
|
|
* @return string
|
2018-09-26 12:07:23 +03:00
|
|
|
*
|
|
|
|
* @api
|
2018-09-03 22:43:02 +03:00
|
|
|
*/
|
|
|
|
public function getCategory()
|
|
|
|
{
|
|
|
|
return 'unsafe';
|
|
|
|
}
|
|
|
|
}
|