Jump to content

Extending Exception


Motig

Recommended Posts

I now get this error: Wrong parameters for Exception([string $exception [, long $code ]])

 

Here is the extending class:

 

class ml_Exception extends Exception
{
    public function __construct($message = null, $code = 0, Exception $previous = null) {
        parent::__construct($message, $code, $previous);
    }

    public function __toString() {
        return "[" . $this->code . "]: <span class=\"error\">" . $this->message . "</span>";
    }
}

 

And the exception is thrown in this line:

 

throw new ml_Exception("User with ID " . $f_id . " does not exist.", 1);

 

Again, help appreciated, thanks

 

Link to comment
https://forums.phpfreaks.com/topic/183447-extending-exception/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.