Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-148

When running cli tasks and there's an exception/error - it's helpful to have detailed information displayed


    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-ALPHA3
    • Fix Version/s: 1.2.0-BETA1
    • Component/s: Cli
    • Labels:
    • Environment:
      Cli Tasks


      We don't always get enough information when an exception happens to track down where the issue is.
      It would be helpful if the tablename and/or the SQL statement was also displayed to help track down problems.

      When trying to load a fixture file I was receiving the following:
      SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'created_at' cannot be null

      As you can see - it doesn't help much as it doesn't display the table/class that's the created_at column is on.

      As quick fix - I modified the rethrowException method in Doctrine_Connection to include some information from the invoker (not a great fix - I should really dig deeper and see if there's a __toString() method on classes that can be passed as the invoker):

      Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
           * rethrowException
           * @throws Doctrine_Connection_Exception
          public function rethrowException(Exception $e, $invoker)
              $event = new Doctrine_Event($this, Doctrine_Event::CONN_ERROR);
              $name = 'Doctrine_Connection_' . $this->driverName . '_Exception';
              $exc  = new $name($e->getMessage() . "\n" . $invoker->getQuery(), (int) $e->getCode());
              if ( ! isset($e->errorInfo) || ! is_array($e->errorInfo)) {
                  $e->errorInfo = array(null, null, null, null);
               if ($this->getAttribute(Doctrine_Core::ATTR_THROW_EXCEPTIONS)) {
                  throw $exc;


        There are no comments yet on this issue.


          • Assignee:
            jwage Jonathan H. Wage
            dasher D Ashwood
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: