mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Add 3 special exception classes for common situations
This commit is contained in:
parent
1863edcbb8
commit
fe4e336f2b
11 changed files with 82 additions and 25 deletions
18
common/framework/exceptions/invalidrequest.php
Normal file
18
common/framework/exceptions/invalidrequest.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Framework\Exceptions;
|
||||
|
||||
/**
|
||||
* The "invalid request" exception class.
|
||||
*/
|
||||
class InvalidRequest extends \Rhymix\Framework\Exception
|
||||
{
|
||||
public function __construct($message = '', $code = 0, $previous = null)
|
||||
{
|
||||
if ($message === '')
|
||||
{
|
||||
$message = lang('msg_invalid_request');
|
||||
}
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
||||
18
common/framework/exceptions/notpermitted.php
Normal file
18
common/framework/exceptions/notpermitted.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Framework\Exceptions;
|
||||
|
||||
/**
|
||||
* The "not permitted" exception class.
|
||||
*/
|
||||
class NotPermitted extends \Rhymix\Framework\Exception
|
||||
{
|
||||
public function __construct($message = '', $code = 0, $previous = null)
|
||||
{
|
||||
if ($message === '')
|
||||
{
|
||||
$message = lang('msg_not_permitted');
|
||||
}
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
||||
18
common/framework/exceptions/targetnotfound.php
Normal file
18
common/framework/exceptions/targetnotfound.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Framework\Exceptions;
|
||||
|
||||
/**
|
||||
* The "target not found" exception class.
|
||||
*/
|
||||
class TargetNotFound extends \Rhymix\Framework\Exception
|
||||
{
|
||||
public function __construct($message = '', $code = 0, $previous = null)
|
||||
{
|
||||
if ($message === '')
|
||||
{
|
||||
$message = lang('msg_not_founded');
|
||||
}
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue