Closed smalot closed 6 years ago
Hello, there are already possibilities to achieve this functionality:
\Igni\Http\Exception\HttpException
$app->use()
or register module implementing \Igni\Http\MiddlewareProvider
I was also thinking about extending ErrorMiddleware
and replacing it with one defined by user if it gets registered. But this will destroy modules that are implementing OnErrorListener
interface.
I have also added PR with upgraded docs and improved current http exception handling https://github.com/igniphp/framework/pull/20
If you want to create a full Rest API, you need to override the
ErrorMiddleware
. But this suppose to override theApplication
too because deErrorMiddleware
is added by default with too many code overriden due to "private" properties and methods.It should be a good thing to restrict "private" properties and methods only when realy needed for security reasons or to forced code override in case of inheritance.
What's your point of view ?