Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.


Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Invalid error type specified


2 Posts   1873 Views


27 September 2007 at 12:29pm Community Member, 9 Posts

I got this today, when trying to do a bit of custom formy type guff:

Invalid error type specified
At line 293 in .../sapphire/security/Geoip.php

It appears that the 'ip2country' function tries to throw an error of type 'E_trigger_error' if it can't resolve a country from a given IP. Unfortunately this constant doesn't exist.

Strangely enough the error didn't occur on another machine running the same code base. This machine also would not have been able to resolve the IP as it also does not have the geoiplookup executable installed. I realise this could be due to all sort of factors, i.e. different php version, error_reporting level etc... I just though I would throw it in for good measure.

I was told (in irc) to post an elegant fix to this bug so that it can be resolved in the next version so here goes: How about change 'E_trigger_error' to 'E_WARNING'. There you go, it's so elegant it makes Princess Di look like Paris Hilton :D


27 September 2007 at 1:38pm Community Member, 9 Posts

Let me be the first to correct myself....

It would seem that trigger_error does not allow for use of the 'E_WARNING' error type, there goes my elegant solution :/