Welcome Guest, Not a member yet? Register   Sign In
An ExceptionNotifier that works
#1

[eluser]Unknown[/eluser]
I've been working on a large-ish CI application, and have really wanted an equivalent to Rails' ExceptionNotifier for a while. Anyhow, the only snippet I found for this was pretty useless when it came to CI 1.7.1, so I wrote my own. You just drop it into your application's
Code:
library
directory, and call it
Code:
MY_Exceptions.php
- it'll extend the
Code:
CI_Exceptions
class.

A few things to note: I have multiple environments I deploy to, using Capistrano; I have a separate config.php for each envrionment, so the reason we compare the current domain to the base_url setting is so we only receive emails from the "live" environment. You'll need error logging set to 1 or greater, and obviously you'll need to add your own details to the script. But other than that: it really does work quite nicely.

Blog post explaining more here.

Get the code from this Gist.

I should have a few more tiny fragments I can share from this project - an improved paginator class, and a wrapper for APC caching, for starters; they're not big, but they turned out useful for me.




Theme © iAndrew 2016 - Forum software by © MyBB