public function __construct(ErrorMessage $error)
{
// Use description, this is the exception message from sever, message is only the HTTP status message.
parent::__construct($error->description, $error->code);
// These are only set if server is running in debug mode, but even if not set we want to overwrite the values.
$this->file = (string) $error->file;
$this->line = (int) $error->line;
$this->trace = explode("\n", (string) $error->trace);
}