graphql-php/tests/Server/Unsafe.php

33 lines
631 B
PHP
Raw Normal View History

2018-09-03 22:43:02 +03:00
<?php
2018-09-03 23:12:03 +03:00
namespace GraphQL\Tests\Server;
2018-09-03 22:43:02 +03:00
use GraphQL\Error\ClientAware;
class Unsafe extends \Exception implements ClientAware
{
/**
* Returns true when exception message is safe to be displayed to a client.
*
* @api
* @return bool
*/
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.
*
* @api
* @return string
*/
public function getCategory()
{
return 'unsafe';
}
}