Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 03:55 AM
toufik toufik
Guest
 
Posts: n/a
Default error type in PHP

I'm using the errorHandler function
(http://www.zend.com/zend/spotlight/error.php) to manage error handling in
my code, the problem is that in all the tests that I did the error type is
always E_WARNING, I've tested the div by 0, database error,....
how can I have an E_ERROR, because I need that the execution stops in teh
case of E_ERROR errors.
Thanks.





  #2  
Old July 17th, 2005, 03:55 AM
Pedro Graca
Guest
 
Posts: n/a
Default Re: error type in PHP

toufik toufik wrote:[color=blue]
> I'm using the errorHandler function
> (http://www.zend.com/zend/spotlight/error.php) to manage error handling in
> my code, the problem is that in all the tests that I did the error type is
> always E_WARNING, I've tested the div by 0, database error,....
> how can I have an E_ERROR, because I need that the execution stops in teh
> case of E_ERROR errors.[/color]

You can't

<quote src="http://www.php.net/set_error_handler">
Note: The following error types cannot be handled with a
user defined function: E_ERROR, E_PARSE, E_CORE_ERROR,
E_CORE_WARNING, E_COMPILE_ERROR and E_COMPILE_WARNING.
</quote>


The most you can achieve is a E_USER_ERROR

<?php
if ($divisor == 0) trigger_error('Division by zero', E_USER_ERROR);
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.