mirror of
https://github.com/friendica/friendica
synced 2025-04-22 11:10:11 +00:00
Make Router::getModuleClass throw exceptions
- Add new MethodNotAllowedModule - Add new Module->determineClass catch blocks - Update Module and Router tests
This commit is contained in:
parent
bfcae2f79a
commit
4ee9e21a4f
6 changed files with 122 additions and 41 deletions
15
src/Module/HTTPException/MethodNotAllowed.php
Normal file
15
src/Module/HTTPException/MethodNotAllowed.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module\HTTPException;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Network\HTTPException;
|
||||
|
||||
class MethodNotAllowed extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
throw new HTTPException\MethodNotAllowedException(L10n::t('Method Not Allowed.'));
|
||||
}
|
||||
}
|
15
src/Module/HTTPException/PageNotFound.php
Normal file
15
src/Module/HTTPException/PageNotFound.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module\HTTPException;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Network\HTTPException;
|
||||
|
||||
class PageNotFound extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
throw new HTTPException\NotFoundException(L10n::t('Page not found.'));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue