Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Where is ErrorCode constant for PhpErrorException?
  • I was trying to parse the Json request body that was sent to my REST API and I would like to confirm the json is in a proper format.

    To make my life easier, I converted json into StdClass, let the code access whatever property is expected.  If the property is not exists, FuelPHP will throw an PhpErrorException with message Undefined Property xxxxxxx....

    I can see the getCode returns 8, but I would like to know is that 8 means Undefined Property?  And is there a list of possible error code I can refers to?
  • HarroHarro
    Accepted Answer
    No, these are PHP error codes, indicating the type of error. The codes are defined here: http://php.net/manual/en/errorfunc.constants.php where you see that 8 means "PHP Notice".

    You would have to interpret the message to know what the exact notice was, in your case an undefined property.
  • I guess that's the only way!  Thanks again @Harro! :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion