Sign in to follow this  

a PHP error reporting library I've built to finally give pretty errors

Recommended Posts

StudioFortress    5

About a month ago I finally decided to look into wrapping PHP error reporting, to display better errors, and this is the result. PHP Error gives you prettier output, making it easier to 'get' an error in less time. This includes a fully syntax highlighted stack trace, code snippets, improved error messages, and it replaces the output so they aren't hidden behind any HTML or off screen.

What is really special is that it also works with ajax too. When an error strikes, your JS callback is put on hold, and the stack trace is displayed within the page. This allows you to fit the error, and then hit retry, without a page refresh. This feature requires no changes to your JS code, browser extensions, or anything like that. It just works out of the box.

It's also built with deployment in mind, or more how to avoid deploying it. It's simple to integrate (just two lines of code), so you don't need to tie your project to it. You can also run via php.ini, allowing you to keep it entirely out of your projects. Instructions on how to do this are provided on it's GitHub repository.

It can also be globally disabled through php.ini, in case you do accidentally deploy to production, and will only run if 'display_errors' is on anyway.

I've found this very useful on my own sites, especially when I hit an error which isn't related to what I'm working on. I get some insight when it's reported, allowing me to find and fix it slightly sooner.

I others find it as useful as I have.

  • Like 4

Share this post


Link to post
Share on other sites
stevember    135

wow, works really well.

1. Simple to use.

2. Great syntax highlighting.

3. More than enough info to fix.

By far best error reporting I've used.

Share this post


Link to post
Share on other sites
ShMaunder    102

This looks pretty good. Will give it a try laters.

Does it have CLI support as well?

Share this post


Link to post
Share on other sites
StudioFortress    5

Thanks Stevember, I'm glad you like it.

In CLI mode, it currently just goes silent, and gives you the standard PHP output. This is so you don't get tonnes of HTML blasted at you over the command line.

Share this post


Link to post
Share on other sites
Phouchg    2,050

Good idea. My error reporting has thus far been print_r($something); die; :D

Will see about it.

Share this post


Link to post
Share on other sites
articuno1au    1,264

You deserve a cookie for this.

I have no use for it myself (being an ASP coder) but this is still great work >.<

Share this post


Link to post
Share on other sites
SkrillexPy    1

Nice work! I think you deserve to put ads or at least a donate button...

Share this post


Link to post
Share on other sites
StudioFortress    5

One of the reasons I put it as it's own site was to have the possibility of putting an ad on there. So I might definitely put one on now, or a donation button.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.