for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Decorates {@see File} with ErrorPage support
*/
class ErrorPageFileExtension extends DataExtension {
* Used by {@see File::getErrorRecordFor}
*
* @param DataObject $record
* @param int $statusCode
public function updateErrorRecordFor(&$record, $statusCode) {
$errorPage = ErrorPage::get()->filter("ErrorCode", $statusCode)->first();
if($errorPage) {
$record = $errorPage;
}