Part of the EllisLab Network
   
1 of 3
1
UhOh! - Better Errors for CodeIgniter
Posted: 15 July 2010 01:55 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  448
Joined  04-13-2009

UhOh is an extension on CI_Extensions that provides awesome error messages with full back traces and a view of the line with the error.

It catches all errors including:

E_PARSE
E_ERROR
E_USER_ERROR
E_COMPILE_ERROR
E_ERROR
E_USER_ERROR
E_PARSE
E_WARNING
E_USER_WARNING
E_STRICT
E_NOTICE
E_RECOVERABLE_ERROR

It also outputs full back traces for all CodeIgniter system errors. No more “Where is it trying to load that view?”, it will show you the line that called it and the surrounding lines.

UhOh! is based on Kohana v3’s error handling. The file contains some code from the Kohana project.
Kohana License

Some screen shots:
PHP Parser Error: http://cl.ly/1eR7
CodeIgniter Errors (i.e. loading a missing view): http://cl.ly/1epj
Errors from your app using show_error(): http://cl.ly/1euq

Download
Version 1.3: Download on GitHub

Let me know what you think or if you have issues.  Install instructions are in the README.

 Signature 

Blog | UhOh! | Formation | Query Strings in CI

Profile
 
 
Posted: 15 July 2010 02:31 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1835
Joined  12-08-2009

Had to fix line 87 of MY_Exceptions.php:

$file 'APPPATH/'.substr($filestrlen(ABS_APPPATH); 
$file 'APPPATH/'.substr($filestrlen(ABS_APPPATH)); 

I love it… but loading a missing view just gives me the show_error() error from the router (attached), and only after an exceedingly long load time. I’m using modular separation (tested in both 1.7.2 and 2.0) which I imagine is the cause.

 Signature 

@basdflasjk | BitAuth: Authentication and Role-based Permissions | Session Library Replacement


Please read the User Guide! (Upgrading from a previous version?)

Profile
 
 
Posted: 15 July 2010 02:34 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  448
Joined  04-13-2009

You must be running an old version.  Please re-download and re-install.  There is a new errors/error_general.php file as well.


Thanks,
Dan

 Signature 

Blog | UhOh! | Formation | Query Strings in CI

Profile
 
 
Posted: 15 July 2010 02:38 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  448
Joined  04-13-2009

Sorry, I was wrong.  Just fixed the first issue and re-tagged.

Missed the part that said you were running Modular Separation too…I am fixing that.

Dan

 Signature 

Blog | UhOh! | Formation | Query Strings in CI

Profile
 
 
Posted: 15 July 2010 03:05 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  448
Joined  04-13-2009

Just posted version 1.3 which fixes the issue with Modular Separation.  Please re-download the MY_Exceptions.php file and replace the existing one.

Dan

 Signature 

Blog | UhOh! | Formation | Query Strings in CI

Profile
 
 
Posted: 16 July 2010 05:12 AM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  36
Joined  12-28-2006

Thanx a lot! Greate hook!

I said some few words about it at russian - http://mpak666.livejournal.com/540424.html

Profile
 
 
Posted: 16 July 2010 08:33 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  163
Joined  04-27-2007

noctrum how u fixed the error on line 87 ?

it seams i have the same error (i use ci2)

Notice: Use of undefined constant ABS_APPPATH assumed 'ABS_APPPATH' in C:\wamp\www\final\application\core\MY_Exceptions.php  on line 182

Warning
: require(ABS_APPPATHerrors/error_php_custom.php[function.require]failed to open streamNo such file or directory in C:\wamp\www\final\application\core\MY_Exceptions.php on line 182

Fatal error
: require() [function.require]Failed opening required 'ABS_APPPATHerrors/error_php_custom.php' (include_path='.;C:\php5\pear'in C:\wamp\www\final\application\core\MY_Exceptions.php on line 182 
Profile
 
 
Posted: 16 July 2010 09:00 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1835
Joined  12-08-2009

This isn’t the same error, the error I had was on line 87, yours is online 182. I just had to add an extra parenthesis to the end of the statement, which I posted. Dan fixed it almost immediately after that, so unless you downloaded it before I did you don’t have that problem.

ABS_APPPATH is defined in the hook, so you probably haven’t enabled hooks.

 Signature 

@basdflasjk | BitAuth: Authentication and Role-based Permissions | Session Library Replacement


Please read the User Guide! (Upgrading from a previous version?)

Profile
 
 
Posted: 16 July 2010 11:53 AM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  163
Joined  04-27-2007

the hooks are enabled i will have to do some debuging

Profile
 
 
Posted: 22 July 2010 01:18 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  451
Joined  03-10-2007

Great lib! Already helped me out a lot during bugfixing.

 Signature 

Starting with CodeIgniter setup
Senior dev of FuelPHP

Profile
 
 
Posted: 25 July 2010 03:21 AM   [ Ignore ]   [ # 10 ]  
Grad Student
Rank
Total Posts:  81
Joined  05-16-2009

i won’t use this for the same reason i don’t buy paper towels: because i don’t make mistakes. just kidding, nice library smile

 Signature 

sr web applications developer
ci, mysql driven, jquery powered (mostly social web applications)

taky.bz, blackhat

Profile
 
 
   
1 of 3
1