1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

feat: rename default to unknown

This commit is contained in:
Christy Jacob 2022-02-08 02:17:23 +04:00
parent 8dfc56cbde
commit 073ab5565f
3 changed files with 5 additions and 5 deletions

View file

@ -8,8 +8,8 @@ use Appwrite\Extend\Exception;
return [
/** General Errors */
Exception::GENERAL_DEFAULT => [
'name' => Exception::GENERAL_DEFAULT,
Exception::GENERAL_UNKNOWN => [
'name' => Exception::GENERAL_UNKNOWN,
'description' => 'Default error',
'code' => 500,
],

View file

@ -391,7 +391,7 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project, $l
if ($error instanceof Utopia\Exception && $error->getCode() === 400) {
$error = new Exception($error->getMessage(), $error->getCode(), Exception::GENERAL_ARGUMENT_INVALID, $error);
} else {
$error = new Exception($error->getMessage(), $error->getCode(), Exception::GENERAL_DEFAULT, $error);
$error = new Exception($error->getMessage(), $error->getCode(), Exception::GENERAL_UNKNOWN, $error);
}
$template = ($route) ? $route->getLabel('error', null) : null;

View file

@ -34,7 +34,7 @@ class Exception extends \Exception
*/
/** General */
const GENERAL_DEFAULT = 'default';
const GENERAL_UNKNOWN = 'unknown';
const GENERAL_ACCESS_FORBIDDEN = 'access_forbidden';
const GENERAL_UNKNOWN_ORIGIN = 'unknown_origin';
const GENERAL_SERVICE_DISABLED = 'service_disabled';
@ -157,7 +157,7 @@ class Exception extends \Exception
private $type = '';
public function __construct(string $message, int $code = 0, string $type = Exception::GENERAL_DEFAULT, \Throwable $previous = null)
public function __construct(string $message, int $code = 0, string $type = Exception::GENERAL_UNKNOWN, \Throwable $previous = null)
{
$this->type = $type;