Show maintenance error on 500 errors #2151
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request for issue: #1341
Shows custom error message for 500 errors
![image](https://private-user-images.githubusercontent.com/143437854/399411115-37aaa199-bb73-47a2-9169-0d1416584977.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NjkwMTAsIm5iZiI6MTczODg2ODcxMCwicGF0aCI6Ii8xNDM0Mzc4NTQvMzk5NDExMTE1LTM3YWFhMTk5LWJiNzMtNDdhMi05MTY5LTBkMTQxNjU4NDk3Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwNlQxOTA1MTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMTk3ZTE3ZGFmOGM4ZTAyMGYxYmVlNDYyZTllOWFiNDI2ODJkZmYzZjU3MTk3NWU5YTM4YzQyYTBhZDY4ODhkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.wJaoGiJSx-gippLdI3ivh9jPfsbScqauFDBvv4KPo20)
How to test?
You can throw a 500 error from any controller
eg. grep
$this->render('about');
then add the following before the render callthrow new CHttpException(500,'Mock Internal Server Error');
And navigate to http://gigadb.gigasciencejournal.com/site/about to confirm
How have functionalities been implemented?
Updated the
protected/views/site/error.php
with a custom error for 500 code