feat: rename default to unknown
This commit is contained in:
parent
8dfc56cbde
commit
073ab5565f
|
@ -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,
|
||||
],
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue