Make Router::getModuleClass throw exceptions
- Add new MethodNotAllowedModule - Add new Module->determineClass catch blocks - Update Module and Router tests
This commit is contained in:
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.'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user