我有一個基本的控制器動作: public function createAction() { $this->view->disable(); $formData = $this->request->getJsonRawBody(); $user = new Users(); $user->first_name = $formData->first_name; $user->last_name = $formData->last_name; $user->email_address = $formData->email_address; $user->password = $formData->password; // this prints to my debug log. $result = $user->save(); AppLogger::$logger->debug(print_r($result, true)); // this does not print. AppLogger::$logger->debug("oh boy #2"); // this does not print either. // which seems to tell me that the line above it is problematic, // but there is no error output from `phalcon serve` echo Json::encode($result); }我看到的最接近錯誤的是PHP/Phalcon Error: Closed without sending a request; it was probably just an unused speculative preconnection:這出現(xiàn)在 的輸出中phalcon serve。我phalcon serve在 Windows 上運(yùn)行 VSCode。
3 回答
交互式愛情
TA貢獻(xiàn)1712條經(jīng)驗(yàn) 獲得超3個贊
當(dāng)用戶嘗試注銷時遇到同樣的問題,重新啟動我的服務(wù)器(laravel 內(nèi)置服務(wù)器)并且它非常有效。
莫回?zé)o
TA貢獻(xiàn)1865條經(jīng)驗(yàn) 獲得超7個贊
我通過包裝$result = $user->save();在 try/catch 中解決了這個問題,然后我能夠看到異常。
似乎這個異常并沒有自動顯示在終端輸出中......
MM們
TA貢獻(xiàn)1886條經(jīng)驗(yàn) 獲得超2個贊
如果您正在克隆 Laravel 項(xiàng)目,請確保您的.env文件已創(chuàng)建。他們有敏感信息,可能會保存在.gitignore中。
- 3 回答
- 0 關(guān)注
- 589 瀏覽
添加回答
舉報
0/150
提交
取消
