From: Mark W. <ma...@rw...> - 2011-03-10 02:08:54
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Hi Scott, <br> <br> Your understanding is spot on. At the moment our error handling does option 3.3 - display an error message. When a fatal error occurs, the php parser calls the registered shutdown function and then we display a big error message, call stacks and source code (whilst debugging is enabled). In the error handling class there is a database logging function which would work if the database table was created. There is also a setting in the errorhandler class that when an error occurs, it can take it, convert it into a Exception and then throw it so that the user code then deals with the error.<br> <br> There are many more comments in the errorhandler class file now and I also tidied it up, so it may be worth taking a look.<br> <br> The final thing that is in there is the exceptionHandler. If an exception is thrown and not caught this function will pick it up and display a fatal error message.<br> <br> If you visit: <a class="moz-txt-link-freetext" href="http://localhost/timesheet/error-test">http://localhost/timesheet/error-test</a> there are a few different errors in that file that can be commented in / out to see how the error handler currently responds. The file resides in /content/error-test.php<br> <br> I'm sure you will be able to take some inspiration from the joomla error classes to improve ours.<br> <br> Mark<br> <pre class="moz-signature" cols="72">_____________________________________________ Mob: 07725 695178 Email: <a class="moz-txt-link-abbreviated" href="mailto:ma...@rw...">ma...@rw...</a></pre> <br> On 09/03/2011 15:22, Scott Miller wrote: <blockquote cite="mid:AAN...@ma..." type="cite">I say go ahead and check things in. J* classes it is. And I'll start trying to move some things into the site class after you check your stuff in.<br> <br> Error handling is probably my biggest blind spot. I haven't been in the "application development for pay" world since the early 1990's; what I typically write are administration scripts that make my life easier, so I have very little need for advanced error handling. So, I'm asking for the following:<br> <ul> <li>How do I go about using the error handling class(es) correctly?</li> <li>What's the big picture, or theory about how it is supposed to work?</li> <li>What does the user see when an arbitrary error occurs? <br> </li> <li>What functions are called for that output to be produced?</li> </ul> So, asking for that doesn't give you a good launching pad to start with, so, I'll help you out here. And I understand it's in flux yet, so just answer as best you can.<br> <br> My understanding about error handling:<br> <ol> <li>PHP program loads</li> <li>an error handling function is registered so that when errors occur, this function is called instead of whatever default action would normally be taken</li> <li>the function needs to check what the severity level of the error is and then does something (one launching area, what does ours do?)</li> <ol> <li>It could, as I gather what Joomla does, put all the errors on a stack, which it later, presumably, deals with them appropriately<br> </li> <li>it could stuff the error message(s) into a usually ignored log file</li> <li>it could immediately create a pop-up displaying the error to the user<br> </li> <li>it could email the administrator(s)</li> <li>I'm sure there are other possibilities I'm not mentioning</li> <li>It could do multiple combination's of these actions</li> </ol> <li>(another launching point) Somehow, for some errors, the user must be notified, how does ours go about that?</li> </ol> So, I've avoided looking at the current error handling classes up to now 'cause I assume it will take a lot of effort to be able to wrap my brain around enough of the code to tease out the "theory" of how our error handling class(es) is(are) supposed to work. So, at this point I don't yet know the function or method names of our error handling class(es).<br> <br> -Scott<br> <br> <div class="gmail_quote">On Tue, Mar 8, 2011 at 11:48 PM, Mark Wrightson <span dir="ltr"><<a moz-do-not-send="true" href="mailto:ma...@rw...">ma...@rw...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> Hello,<br> <br> I have got quite a few updates to make to the site loading aspects of the site aswell as a neat way to tidy up the root directory, but it will mean quite a few files will change or even move. Therefore, before I am asking whether anyone has any outstanding changes before I do anything?<br> <br> Main updates include:<br> <br> a) Updated the error handler code to give trace stacks, show the actual line of code at fault and just generally more debug information.<br> <br> b)Updated site class, integrated the installation handling stuff into site class thus removing install.site.class and other install related files that were effectively nasty duplication hacks.<br> <br> c) tidied up the template parser code.<br> d) implemented template parser tags that allow functions as well as files to be called.<br> <br> e)a method to tidy up the root directory.<br> <br> f) implemented a method to log errors to a database (optional)<br> <br> Now in reference to Scotts email:<br> <br> Certainly for now we may aswell leave the class names as J*. It is only a find a replace if we want to change them later.<br> <br> What do you need to know about the error handler class? - the code is still not very mature and lots can be done with it to tidy it up and improve its functionality.<br> <br> I agree, most of the code (the initialisation stuff) in test-lang-stuff.php could go into the site class.<br> <br> Thanks<br> <br> Mark<br> <br> _____________________________________________<br> <br> Mob: 07725 695178<br> Email: <a moz-do-not-send="true" href="mailto:ma...@rw..." target="_blank">ma...@rw...</a> <div> <div class="h5"><br> <br> <br> On 08/03/2011 23:16, Scott Miller wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> Hi all,<br> <br> I've checked in a few more changes, mainly focused on further trimming down of un-needed stuff from the various classes, and the removal of un-needed classes.<br> <br> I'm still waiting for a discussion on whether we want to continue using J* class names (JLanguage, JText, JFile, JFolder, etc) or if we want to use something different, and if so, what.<br> <br> Also still waiting to hear about how the error classes work, and how to replace the commented out error stuff in the jclasses with error stuff that will actually work for us.<br> <br> I'm beginning to think about how to go about integrating the JLanguage stuff into our existing classes. Should the JLanguage stuff be part of the master site class? I'm currently thinking it should.<br> <br> Isabelle, I think it will be useful to have language specific routines that deal with how to correctly format times, dates, and numbers in general. Can you point us in the right direction as to how to go about doing this?<br> <br> -Scott<br> </blockquote> </div> </div> </blockquote> </div> <br> </blockquote> </body> </html> |