English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have PHP 5.2.1, and my try/catch blocks have all stopped working.

You can check out all of my configuration settings at http://www.finallyfitness.net/info.php (Yahoo truncates the address, but it's still a functioning link-- it shows the result of calling phpinfo() on my server).

The following code generates the following error message:

******
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

try
{
if (1 == 1)
throw new Exception("Ick!");
}
catch(Exception $e)
{
echo $e->getMessage();
exit();
}
?>

*****
Fatal error: Uncaught exception 'Exception' with message 'Ick!' in /home/ goddess/ public_html/ except.php:9 Stack trace: #0 {main} thrown in /home/ goddess/ public_html/ except.php on line 9

Why in the world wouldn't this code work? If it's a problem with my server rather than my code, do you have any idea what the problem might be (so I can get the tech guys at my server to fix it)?

Any insight would be appreciated!

2007-03-07 10:16:36 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

To csanon:

None of the answers I've received have helped me fix my problem. Yes, I have read what the manual has to say about try/catch blocks, and I've come to the decision that the problem is with my server, not my code.

However, if people with more experience than myself can point out my problem so I can have the tech people at my server fix it, it would help me greatly-- I'm working on a school project, and this issue has stalled my progress completely.

If you don't want to answer my question, feel free to ignore my posts, but it's very unkind to be so snobby about it. Every post I've made has had some new information that I though might help some solve my problem.

:o(

2007-03-07 10:26:34 · update #1

3 answers

Your code does not have any error. It works fine with me. I think some problem on your server. But I am not sure what configurations do we need to throw/catch exceptions.

2007-03-07 20:45:44 · answer #1 · answered by Atif Majid 3 · 0 0

I had no longer heard of that. thank you for the top! I even have those self cleansing muddle packing containers and "Worlds ultimate cat muddle" works relatively properly. that's a organic corn cob muddle that clumps properly. the only element is that I even have tried each thing, finished extremely some examine and my Bengal cat nevertheless dumps on the floor applicable outdoors the muddle field. i've got tried such varied issues. He pees interior the field (perched on the section, what a weirdo) yet he looks to think of his poo is a remarkable floor ornament that one and all ought to appreciate. i'm thinking of putting yet yet another muddle field in there, possibly with this muddle and spot if he will take to it. thank you lower back! P.S. being timber/sawdust, ought to I compost it?

2016-12-18 17:34:52 · answer #2 · answered by ? 3 · 0 0

OK, here's a question for you: do you bother to read the manual? Look, you asked a variation of this question 4 times already. It's been answered properly before:

http://answers.yahoo.com/question/index;_ylt=At8jtawxlt_GvIbqvKqX6pojzKIX?qid=20070307065205AASI79v

See, a sign of intelligent life is the ability to learn from mistakes. Seems you don't bother reading and figuring out what you are doing wrong. Your loss.

2007-03-07 10:21:54 · answer #3 · answered by csanon 6 · 0 0

fedest.com, questions and answers