unvisible exceptions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ls-l
Forum Newbie
Posts: 3
Joined: Thu Jul 03, 2008 3:16 am

unvisible exceptions

Post by ls-l »

don't know why when I type

Code: Select all

<?php
    throw new Exception('a');
    
?>
doesn't return any code, just white page... Every exception works like this (or rather doesn't work), don't know why, if it's fail of apache or php...
kilermedia
Forum Newbie
Posts: 7
Joined: Wed Jul 02, 2008 11:00 pm
Location: California, USA

Re: unvisible exceptions

Post by kilermedia »

You need to setup the handler first. It's printing nothing because you haven't set it to anything.

See PHP.net for details.
ls-l
Forum Newbie
Posts: 3
Joined: Thu Jul 03, 2008 3:16 am

Re: unvisible exceptions

Post by ls-l »

thank you

and is it possible to put it somewhere in configuration files so that I wouldn't have to put it let's say 'everywhere'
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Re: unvisible exceptions

Post by shiznatix »

If you use a bootstrap file you can set it there so it will always be set. That would be the easiest way. Or if you have some file that you include every page hit then throw it in there.
ls-l
Forum Newbie
Posts: 3
Joined: Thu Jul 03, 2008 3:16 am

Re: unvisible exceptions

Post by ls-l »

ok, that's what I thought about, but I meant editing php.ini or similar file so that my code wouldn't have that line
it's because I'm working over team project and don't want to dirt global code
Post Reply