Update in error status code

Add example If you will add specific status code for the browser
This commit is contained in:
Mauro Tschiedel
2021-09-01 08:22:12 -03:00
committed by GitHub
parent 749f252ffb
commit 0097725ef2
+6
View File
@@ -972,6 +972,12 @@ If you do not want a redirect, but want the error-page rendered on the current-u
$request->setRewriteCallback('ErrorController@notFound'); $request->setRewriteCallback('ErrorController@notFound');
``` ```
If you will set the correct status for the browser error use:
```php
SimpleRouter::response()->httpCode(404);
```
## Using custom exception handlers ## Using custom exception handlers
This is a basic example of an ExceptionHandler implementation (please see "[Easily overwrite route about to be loaded](#easily-overwrite-route-about-to-be-loaded)" for examples on how to change callback). This is a basic example of an ExceptionHandler implementation (please see "[Easily overwrite route about to be loaded](#easily-overwrite-route-about-to-be-loaded)" for examples on how to change callback).