Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Invalid error type specified

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

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

Page: 1
Go to End
Author Topic: 1771 Views
  • billy
    Avatar
    Community Member
    9 Posts

    Invalid error type specified Link to this post

    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

  • billy
    Avatar
    Community Member
    9 Posts

    Re: Invalid error type specified Link to this post

    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 :/

    1771 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.