public static function fromException(Exception $e) { $obj = new self(); $obj->setException(get_class($e)); $obj->setMessage($e->getMessage()); $obj->setCode($e->getCode()); $obj->setTrace($e->getTraceAsString()); return $obj; }