0

現在、プロジェクトで次のものを使用しています。

  • シンフォニー 2.3.11
  • SQL Server 2008
  • Doctrine 2 (最新) + pdo_sqlsrv (5.5)
  • PHP 5.5.3

を呼び出すときに次のことを行っています$em->flush()

try {
    $this->em->flush();
} catch (\PDOException $e) {
    switch ($e->getCode() {
        case /*Depending of the codes*/:
            throw new \Exception(/*Message that hides the real error and just gives the code and a user-friendly message*/);
    }
}

ただし、このアクションでは引き続き SQL Server エラーが表示され、クエリと内部構造がユーザーに公開されます。これらのエラーをキャッチして、より適切なメッセージに変換するにはどうすればよいですか? よろしくお願いします。

4

1 に答える 1