I need to know how to stop errors displaying on screen and switch to not found when calling a database with
$this->projectCategory = DataObject::get_one($id, "`$id`.`URLSegment`='$secondId'"
. Bad class to singleton() - Business5Area
sorry I posted by accident before finialising the post.
anyway the problem I have is I am ge3tting the class from the URL so if someone miss types the URL they don't get a page not found they get a silverstripe error. I have attempted try->catch and this left the same problem. Is there any silverstripe way to catch an error like this and send to a safe page instead of displaying all the errors on the screen. btw if I set the site to live version I still get the blue screen just with the non descript error.
Hope this is a simple thing I a missing out on.