We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65c0adb commit 5493a28Copy full SHA for 5493a28
code/ModelAdmin.php
@@ -3,6 +3,7 @@
3
namespace SilverStripe\Admin;
4
5
use InvalidArgumentException;
6
+use Psr\Log\LoggerInterface;
7
use SilverStripe\Control\Controller;
8
use SilverStripe\Control\HTTPRequest;
9
use SilverStripe\Control\HTTPResponse;
@@ -162,7 +163,8 @@ protected function init()
162
163
$this->modelTab = $this->unsanitiseClassName($this->modelTab);
164
165
if (!$this->isManagedModel($this->modelTab)) {
- throw new \RuntimeException(sprintf('ModelAdmin::init(): Invalid Model class %s', $this->modelTab));
166
+ Injector::inst()->get(LoggerInterface::class)->error(sprintf('ModelAdmin::init(): Invalid Model class %s', $this->modelTab));
167
+ return $this->httpError(404, 'Page not found');
168
}
169
170
0 commit comments