Hi guys
i want to know a simple thing that if its possible to create default error page for whole project
Like on any of the pages in the project if script break than i want to display custom error page instead of that
big scary red and yellow error screen to user
So is it possible or i have to handle error on each controller manually???
Bizley
(Bizley)
October 16, 2015, 8:46am
2
Add and modify this key in your configuration:
return [
'components' => [
'errorHandler' => [
'errorAction' => // url of error action here
],
],
];
ajith
(Ajith Tejas)
October 19, 2015, 6:43am
4
Bizley:
Add and modify this key in your configuration:
return [
'components' => [
'errorHandler' => [
'errorAction' => // url of error action here
],
],
];
hey,
if i use this solution, for every type of error i get redirected to same page (page not found(404) , permission error(403)). ie, if a user comes across a 404 he get redirected to a page lets say ‘X’ and if the same user comes across 403 he would get redirected to ‘X’ itself isn’t it?
if so how can i handle different types of error?
Bizley
(Bizley)
October 19, 2015, 7:44am
5
You can check the type of error in your action and handle it from there.