public function excluirProduto() { try { if (empty($_POST['id'])) { throw new \Exception("Selecione um produto."); } $produto = new Produto(); $produto->id = $_POST['id']; $this->fachada->excluirProduto($produto); echo new JSONResponse(true, self::MSG_OPERACAO_SUCESSO); } catch (\Exception $e) { echo new JSONResponse(false, $e->getMessage()); } }