3060 Posts in 864 Topics by 646 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 917 Views |
-
how to stop errors displaying on screen and switch to not found . Bad class to singleton() - Business5Area

17 September 2009 at 9:10am Last edited: 17 September 2009 9:15am
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
edit:
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.
-
Re: how to stop errors displaying on screen and switch to not found . Bad class to singleton() - Business5Area

17 September 2009 at 6:32pm
you can use class_exists to test if a string is a valid classname. class_exists($id)
-
Re: how to stop errors displaying on screen and switch to not found . Bad class to singleton() - Business5Area

18 September 2009 at 9:32am
Thanks
Once again you saved my life.
| 917 Views | ||
|
Page:
1
|
Go to Top |


