Page 1 of 1

JError is deprecated what should we use instead

Posted: Tue Oct 11, 2011 4:06 pm
by enav
Im creating a demo about the joomla API and just found that the class JError is deprecated and heart that this class will be dropped at 12.1

What should we use instead?

the only information i fond is here
https://github.com/joomla/joomla-platform/issues/246

Re: JError is deprecated what should we use instead

Posted: Wed Oct 12, 2011 9:37 am
by RedEye
use PHP Exception
yeah it will be dropped, but that will take a while, not before J!3.0 I guess

Re: JError is deprecated what should we use instead

Posted: Sat Feb 04, 2012 11:00 am
by roelandae
It would be nice though to have some examples of how to use the php exception.
It is much harder now to find all functions that have been deprecated. The logs are filled with deprecated messages for the error class, which is not too helpful.

Re: JError is deprecated what should we use instead

Posted: Sat Feb 04, 2012 3:44 pm
by alwarren
It's used over 900 times in the core. My guess is they want to do away with the pat-based code. Surely they'll come up with an alternative.

Re: JError is deprecated what should we use instead

Posted: Sat Feb 04, 2012 4:03 pm
by enav
If you guys use ana IDE for developement, for example "Eclipse IDE" it just change the color of deprecated functions and show the respective message located on the function comments, you can also press control + click over the function anme to opent its code and see the deprecation message

Re: JError is deprecated what should we use instead

Posted: Tue Feb 14, 2012 12:59 pm
by realityking
While JError is deprecated we're not gonna be able to get rid of it too soon.

Stuff that should be logged and not output to the user should use JLog. For anything output to the user you're pretty much stuck with JError for now.

Re: JError is deprecated what should we use instead

Posted: Tue Feb 14, 2012 3:43 pm
by roelandae
Thank you for your reply!
I am still trying to get my head around it, but I'll figure it out.