first commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exceptions_AccessDenied extends Brizy_Editor_Exceptions_Exception {
|
||||
protected $code = 401;
|
||||
|
||||
protected $message = 'Unauthorised access';
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exceptions_DataVersionMismatch extends Exception {
|
||||
}
|
||||
16
wp-content/plugins/brizy/editor/exceptions/exception.php
Normal file
16
wp-content/plugins/brizy/editor/exceptions/exception.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exceptions_Exception extends Exception implements Serializable {
|
||||
protected $code = 500;
|
||||
protected $message = 'Internal server error';
|
||||
|
||||
public function serialize() {
|
||||
return serialize( [ 'code' => $this->getCode(), 'message' => $this->getMessage() ] );
|
||||
}
|
||||
|
||||
public function unserialize( $serialized ) {
|
||||
$data = $this->unserialize( $serialized );
|
||||
$this->code = $data['code'];
|
||||
$this->message = $data['message'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exceptions_InvalidContent extends Brizy_Editor_Exceptions_Exception {
|
||||
protected $message = 'Content is invalid';
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exception_NotBrizyPage extends Brizy_Editor_Exceptions_NotFound {
|
||||
protected $message = 'Invalid page';
|
||||
}
|
||||
12
wp-content/plugins/brizy/editor/exceptions/not-found.php
Normal file
12
wp-content/plugins/brizy/editor/exceptions/not-found.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exceptions_NotFound extends Brizy_Editor_Exceptions_Exception {
|
||||
protected $code = 404;
|
||||
|
||||
protected $message = 'Not Found';
|
||||
|
||||
|
||||
public function __construct( $message = "", $code = 0, Throwable $previous = null ) {
|
||||
parent::__construct( $message, $code, $previous );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exceptions_ServiceUnavailable extends Brizy_Editor_Exceptions_Exception {
|
||||
protected $code = 503;
|
||||
|
||||
protected $message = 'Service Unavailable';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exceptions_SignatureMismatch extends Brizy_Editor_Exceptions_Exception {
|
||||
protected $code = 409;
|
||||
protected $message = 'Signature mismatch';
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
class Brizy_Editor_Exceptions_UnsupportedPostType extends Brizy_Editor_Exceptions_NotFound {}
|
||||
Reference in New Issue
Block a user