On Facebook, codeigniter and errors

When you throw an error in codeigniter, it gives you helpful little error pages.  Helpful, that is, if you are building for a domain rather than building a facebook app.  Those error pages will generate a decidedly un-helpful facebook errors because they have body tags (and probably other stuff that’s not going to make it through fb’s re-interpreting).  The solution, though, is sweetly simple:

(fbml apps only, iframe you’re likely not having this problem)

In your errors directory change the markup for error_404, error_db, error_general and error_php to something like this

<fb:error>

<fb:message><?=$heading?></fb:message>

<?=$message?>

</fb:error>

Nothing else, just that line, and when you see that error on the facebook side it will be styled just like an error from fb itself.

January 26th, 2009 - Posted in Web-Dev | |