mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 08:17:12 +02:00
Update WireException class to support setting message and code
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
* This file is licensed under the MIT license
|
* This file is licensed under the MIT license
|
||||||
* https://processwire.com/about/license/mit/
|
* https://processwire.com/about/license/mit/
|
||||||
*
|
*
|
||||||
* ProcessWire 3.x, Copyright 2018 by Ryan Cramer
|
* ProcessWire 3.x, Copyright 2020 by Ryan Cramer
|
||||||
* https://processwire.com
|
* https://processwire.com
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -17,7 +17,29 @@
|
|||||||
* Generic ProcessWire exception
|
* Generic ProcessWire exception
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class WireException extends \Exception {}
|
class WireException extends \Exception {
|
||||||
|
/**
|
||||||
|
* Replace previously set message
|
||||||
|
*
|
||||||
|
* @param string $message
|
||||||
|
* @since 3.0.150
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function setMessage($message) {
|
||||||
|
$this->message = $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace previously set code
|
||||||
|
*
|
||||||
|
* @param int $code
|
||||||
|
* @since 3.0.150
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function setCode($code) {
|
||||||
|
$this->code = $code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when access to a resource is not allowed
|
* Thrown when access to a resource is not allowed
|
||||||
|
Reference in New Issue
Block a user