Update error.php

<?php if ((!$statusFixed) && ($this->countModules('status'))) : ?>
needs to be changed by
<?php if ((!$statusFixed) && ($this->getInstance()->countModules('status'))) :?>

$this is, at that point, instantiated to JDocumentError which has not countModules method throwing an error.