dqvtm82066
2015-04-19 16:33
采纳率: 0%
浏览 30
已采纳

在Symfony2中捕获数据库异常

I've got a random problem that I can't narrow down. Occasionally, I will get the following error in a Symfony2 application:

Uncaught Exception: An exception occured in driver: SQLSTATE[08004] [1040] Too many connections {"type":1,"file":"/var/www/symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php","line":115,"level":30709

I would like to setup an application-wide listener to catch the PDOException and log some information. How can I hook into Symfony to only catch PDOException?

图片转代码服务由CSDN问答提供 功能建议

我有一个随机的问题,我无法缩小范围。 有时,我会在Symfony2应用程序中收到以下错误:

未捕获异常:驱动程序中发生异常:SQLSTATE [08004] [1040]连接太多{“{1040] 类型 “:1,” 文件 “:”/无功/网络/ symfony的/供应商/教义/ DBAL / LIB /学说/ DBAL /驱动程序/ AbstractMySQLDriver.php”, “行”:115, “电平”:30709

我想设置一个应用程序范围的侦听器来捕获 PDOException 并记录一些信息。 如何挂钩到Symfony只捕获 PDOException

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题