Joomla! Discussion Forums



It is currently Thu Nov 26, 2009 10:17 pm (All times are UTC )

 




Post new topic Reply to topic  [ 16 posts ] 
Author Message
Posted: Thu Dec 15, 2005 8:44 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Wed Aug 17, 2005 11:03 pm
Posts: 1356
Location: New Orleans, Louisiana
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

_________________
Development Working Group Coordinator
http://webimagery.net - Consulting
http://jxtended.com - Solutions for Joomla! 1.5
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
  E-mail  
 
Posted: Thu Dec 15, 2005 9:01 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

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

_________________
Olivier
interfaSys sàrl


Top
  E-mail  
 
Posted: Tue Feb 14, 2006 9:11 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

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
  E-mail  
 
Posted: Thu Mar 09, 2006 7:34 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Wed Aug 24, 2005 9:34 am
Posts: 662
Location: Bodø, 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
BEDRE Reklame as - http://www.bedre.no
twitter.com/BEDREreklame


Top
  E-mail  
 
Posted: Thu Mar 09, 2006 8:28 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
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.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
Posted: Fri Mar 10, 2006 1:08 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Wed Aug 24, 2005 9:34 am
Posts: 662
Location: Bodø, 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
BEDRE Reklame as - http://www.bedre.no
twitter.com/BEDREreklame


Top
  E-mail  
 
Posted: Mon Oct 09, 2006 4:48 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Aug 20, 2005 12:32 pm
Posts: 990
Location: Tewkesbury, 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 Expert Joomla-Only Developer
Blue Flame IT Ltd.
-- http://www.phil-taylor.com/
SPEED UP Joomla 1.5.x Admin Console with this: http://extensions.joomla.org/extensions ... 53/details


Top
   
 
Posted: Wed Oct 11, 2006 11:04 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Thu Aug 18, 2005 8:57 am
Posts: 1247
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.

_________________
Joomla Leadership Team - Production Working Group
Joomla Documentation Coordinator

Davenport Technology Services (http://davenporttechnology.com)


Top
  E-mail  
 
Posted: Sat Jan 13, 2007 5:16 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Thu Aug 18, 2005 8:57 am
Posts: 1247
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.

_________________
Joomla Leadership Team - Production Working Group
Joomla Documentation Coordinator

Davenport Technology Services (http://davenporttechnology.com)


Top
  E-mail  
 
Posted: Fri May 25, 2007 2:46 am 
Joomla! Intern
Joomla! Intern
Offline

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
  E-mail  
 
Posted: Tue Aug 21, 2007 4:09 pm 
Joomla! Explorer
Joomla! Explorer
Offline

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


Top
  E-mail  
 
Posted: Wed Mar 26, 2008 11:13 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Wed Aug 24, 2005 9:34 am
Posts: 662
Location: Bodø, 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
BEDRE Reklame as - http://www.bedre.no
twitter.com/BEDREreklame


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

Top
  E-mail  
 
Posted: Wed Mar 26, 2008 11:19 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Wed Aug 24, 2005 9:34 am
Posts: 662
Location: Bodø, 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
BEDRE Reklame as - http://www.bedre.no
twitter.com/BEDREreklame


Top
  E-mail  
 
Posted: Wed Mar 26, 2008 12:56 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
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.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
Posted: Fri Jul 31, 2009 9:13 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Jul 24, 2009 8:35 am
Posts: 39
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
  E-mail  
 
Posted: Thu Sep 17, 2009 4:04 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Thu Feb 07, 2008 3:08 pm
Posts: 118
We look forward to the development of you.

_________________
http://www.paikad.com/index.php/ครีมหน้าขาว.html
http://www.paikad.com


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ] 

Quick reply

 



Who is online

Users browsing this forum: Andreas Berger, hummblebee, moisesgdiaz, quayfee, tommytoxen and 24 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 © 2000, 2002, 2005, 2007 phpBB Group