The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ] 
Author Message
PostPosted: Thu Dec 15, 2005 8:44 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Wed Aug 17, 2005 11:03 pm
Posts: 1388
Location: San Jose, California
Hello all,

I thought I would quickly go over one of the changes in the upcoming 1.5 release.  Though it was not part of the original roadmap for 1.5, the team determined that it would be beneficial to have a common error manager in Joomla.  This would provide a common interface for both the core and 3rd party developers to handle errors.  After some research was done, the decision was made to wrap the existing patError class that is packaged with patTemplate.  This system provides a whole host of functionality and remains quite lightweight considering its power.  The necessary functionality has been wrapped by a new static class called: JError.

For an overview of how patError works please see: http://www.php-tools.net/site.php?&file=/patError/overview.xml

For online documentation of patError please see: http://www.php-tools.net/site.php?&file=patError/doc/intro.xml

Obviously we will be creating our own documentation and a how-to guide for third party developers as well.  The JError class can be seen in the file: JROOT/libraries/joomla/classes/error.php

A couple of the advantages of using this class will be that all error conditions will have a universal look/feel for the user, and if used properly the user would have exactly the information needed for a developer to fix a bug.

Also, an error system template has been created for displaying errors.  This goes a long way to keeping Joomla looking good, even in the worst of times :)


Obviously more information to come...

Louis

_________________
Joomla Platform Maintainer
A hacker does for love what others would not do for money.


Last edited by Jinx on Sat Apr 01, 2006 11:35 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Dec 15, 2005 9:01 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Aug 19, 2005 12:15 am
Posts: 18
Location: Lausanne, Switzerland
Sounds great!

_________________
Olivier
interfaSys sàrl


Top
 Profile  
 
PostPosted: Tue Feb 14, 2006 9:11 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Oct 08, 2005 12:17 pm
Posts: 21
Sounds greet indead. For developers it's very welcome and I hope it speeds up development. Error handling eats up most of my time  :P


Top
 Profile  
 
PostPosted: Thu Mar 09, 2006 7:34 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Wed Aug 24, 2005 9:34 am
Posts: 726
Location: Rørvik, Norway
Sounds great. Some examples on how to put it to good use in a joomla application would be nice... Or some pointers to core Joomla code that uses it perhaps?

_________________
Torkil Johnsen
http://torkiljohnsen.com
http://twitter.com/torkilj


Top
 Profile  
 
PostPosted: Thu Mar 09, 2006 8:28 pm 
User avatar
Joomla! Champion
Joomla! Champion

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6569
We will try to provide more documentation in the coming weeks. The error handlers are used in the different classes in the framework. A good start is the JFTP class.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.joomlatools.com - Joomla extensions that just work


Top
 Profile  
 
PostPosted: Fri Mar 10, 2006 1:08 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Wed Aug 24, 2005 9:34 am
Posts: 726
Location: Rørvik, Norway
The JFTP class ideed uses the JError class extensively. I still have to probe a bit further on these error codes.... :)

To sum up: How does one put the error codes to good use when developing third party components?

For instance, from the mkdir function in the JFTP class there is this line of code:
Code:
JError::raiseError('35', 'JFTP::mkdir: Bad response.', 'Server response:'.$this->_response.' [Expected: 257] Path sent:'.$path );


Why is the error code 35 used in here? What good does it do? What does it refer to? Will this result in a 500 error since it is not a 403 or 404?

Louis wrote this paragraph in the dev blog:
Quote:
The default case for errors is a 500 error, because if access isn’t forbidden or the page is not available… obviously there is something wrong within the Joomla! code execution so its an internal server error… make sense? Good.


Does he mean "...if access isn't forbidden and the page is available..." (403 or 404) then the error is an internal server error (500)?

_________________
Torkil Johnsen
http://torkiljohnsen.com
http://twitter.com/torkilj


Top
 Profile  
 
PostPosted: Mon Oct 09, 2006 4:48 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Sat Aug 20, 2005 12:32 pm
Posts: 1118
Location: Weymouth, UK
The links the documentation and overview are not correct after the recent change on their site:

Try this instead:
http://trac.php-tools.net/patError/wiki
http://trac.php-tools.net/patError/wiki/Docs

_________________
Phil Taylor - Full Time Joomla/PHP Expert
Blue Flame IT Ltd.
-- http://myjoomla.com/ Joomla Security/Hack fix Auditing Service
-- http://www.phil-taylor.com/


Top
 Profile  
 
PostPosted: Wed Oct 11, 2006 11:04 am 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Aug 18, 2005 8:57 am
Posts: 1382
Location: Shrewsbury, Shropshire, United Kingdom
PhilTaylor-Prazgod wrote:
The links the documentation and overview are not correct after the recent change on their site:


I've fixed the only link I know about (http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,guidelines:jerror/).

Please let me know if you are aware of any other bad links.

Thanks Phil.

Regards,
Chris.

_________________
Chris Davenport - Joomla Production Leadership Team

Lion Coppice http://www.lioncoppice.org/
Davenport Technology Services http://www.davenporttechnology.com/


Top
 Profile  
 
PostPosted: Sat Jan 13, 2007 5:16 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Aug 18, 2005 8:57 am
Posts: 1382
Location: Shrewsbury, Shropshire, United Kingdom
Hi,

Just thought I'd add a quick note to say that the JError class is no longer dependent on patError.

If someone has the time to re-read and revise (or even extend!) the Joomla! Error Handling guidelines page: http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,guidelines:jerror/ I would be very grateful.

Please submit your amendments here: http://forum.joomla.org/index.php/board,287.0.html.

Regards,
Chris.

_________________
Chris Davenport - Joomla Production Leadership Team

Lion Coppice http://www.lioncoppice.org/
Davenport Technology Services http://www.davenporttechnology.com/


Top
 Profile  
 
PostPosted: Fri May 25, 2007 2:46 am 
Joomla! Intern
Joomla! Intern

Joined: Mon Sep 12, 2005 7:54 am
Posts: 71
I tried executing a mysql query after calling JError::raiseError(); to log errors, but it looks like it doesn't work. Does raising an error block mysql queries? The specific method I was calling is insertObject.

Regards,
Todd


Top
 Profile  
 
PostPosted: Tue Aug 21, 2007 4:09 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Wed Sep 27, 2006 11:55 pm
Posts: 347
I think Exceptions would be a great addition. The next version should go fully PHP5. :)


Top
 Profile  
 
PostPosted: Wed Mar 26, 2008 11:13 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Wed Aug 24, 2005 9:34 am
Posts: 726
Location: Rørvik, Norway
Nothing wrong with using regular PHP Exceptions. JError::isError($obj) is fully capable of determining if $obj is a JException, JError og regular PHP Exception object.

Note:
JException also uses the same function names as the regular PHP Exception class, so it doesn't even take any time getting used to :)

_________________
Torkil Johnsen
http://torkiljohnsen.com
http://twitter.com/torkilj


Last edited by torkil on Wed Mar 26, 2008 11:28 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Mar 26, 2008 11:19 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Wed Aug 24, 2005 9:34 am
Posts: 726
Location: Rørvik, Norway
I have another question though, related to errors:

How is the JObject error functions intended to work into this? Most classes inherit from JObject and can thus use the error-related functions from JObject, but what is the thought behind for instance setError, getError and getErrors? Are we supposed to use this as a storing mechanism for storing multiple errors?

_________________
Torkil Johnsen
http://torkiljohnsen.com
http://twitter.com/torkilj


Top
 Profile  
 
PostPosted: Wed Mar 26, 2008 12:56 pm 
User avatar
Joomla! Champion
Joomla! Champion

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6569
Yes, the idea is that you can store multiple errors in the object. These errors can be errors, notices, warnings or messages and can be retrieved to be acted upon.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.joomlatools.com - Joomla extensions that just work


Top
 Profile  
 
PostPosted: Fri Jul 31, 2009 9:13 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Jul 24, 2009 8:35 am
Posts: 38
Jinx wrote:
Yes, the idea is that you can store multiple errors in the object. These errors can be errors, notices, warnings or messages and can be retrieved to be acted upon.


This sounds great... I hope er can use it soon .

_________________
http://www.alutec.no/


Top
 Profile  
 
PostPosted: Wed Aug 25, 2010 11:36 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Aug 25, 2010 8:59 am
Posts: 9
Jinx wrote:
We will try to provide more documentation in the coming weeks. The error handlers are used in the different classes in the framework. A good start is the JFTP class.


I just wanted to update error management thread with couple of resources for developers, since I see nobody done it:

http://api.joomla.org/Joomla-Framework/ ... Error.html
http://docs.joomla.org/JError

Regards

_________________
Custom made joomla arcades:
- http://www.tripledoublegames.com
- http://www.playcarparkinggames.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ] 



Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group