Click here to get back home

Error Handlers

 HomeNewsGroups | Search

comp.lang.php - PHP programming language discussions 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Error Handlers 703designs 10-08-2008
---> Re: Error Handlers =?ISO-8859-1?Q?...10-08-2008
Posted by 703designs on October 8, 2008, 10:23 am
Please log in for more thread options


How can I add a a row for every error? I know I did this before, but
lost the code. The reason that this is necessary: I want errors to
build into a table which is positioned absolutely (bottom: 1em; left:
1em). I can only have one copy of the table, otherwise errors overlap
each other.

What I have now doesn't work, and I'm not entirely sure why (I know
it's crappy code, but error handling is a black box indeed, plus this
is for a prototype CSS framework, so I'm not being picky):

http://pastebin.com/m29c58d92

Posted by =?ISO-8859-1?Q?=22=C1lvaro_G=2 on October 8, 2008, 11:05 am
Please log in for more thread options


703designs escribió:
show/hide quoted text

show/hide quoted text


What this code seems to do is:

1. Set error count to zero
2. Print errors if error count is greater than zero
3. Tell PHP to user your custom error handler
4. Increase the error count when new errors found

You'd need to move the "print errors" part to the end of your script so
it has the chance of catching some errors before printing them.

Also, be aware that your error handler doesn't honor the @ operator and
it never aborts the script no matter the error type (might be what you
want or not).


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--

Posted by 703designs on October 8, 2008, 12:02 pm
Please log in for more thread options


Thanks Alvaro, that makes perfect sense. This is for only my own use,
mainly to catch missed includes (for wireframing), but I'll certainly
look into making it @-safe, which seems like an interesting topic to
me.

Thomas

On Oct 8, 11:05=A0am, "=C1lvaro G. Vicario"
show/hide quoted text


Similar ThreadsPosted
xmlrpc error faultCode 105 faultString XML error: Invalid document end at line 1, column 1 October 1, 2007, 10:38 am
STRANGE "Fatal error: Call to undefined function..." ERROR May 15, 2005, 3:00 pm
newbie error : syntax error, unexpected T_INC, expecting ')' July 16, 2005, 2:36 pm
Parse error: syntax error, unexpected $end in ... Question/Suggestion April 7, 2006, 1:01 pm
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' July 4, 2007, 5:29 pm
PDO: How to check for a temporary connection error vs. a final error July 26, 2009, 5:36 pm
CGIWrap error: exec format error July 14, 2004, 2:04 pm
Redirect Error Reported As SQL Syntax Error January 8, 2005, 4:45 pm
Date in Apache2's error log when error caused by PHP April 4, 2005, 7:51 pm
Understanding error masking in error handling... November 7, 2008, 3:41 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy