<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 22:00:59 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DBAL-371/DBAL-371.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DBAL-371] DBALException doesn&apos;t forward the SQL exception code</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-371</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;PDO exceptions carry the SQL error code. However DBALException doesn&apos;t forward any error code from the SQL exception.&lt;/p&gt;

&lt;p&gt;Here is a (really poor/quick) example of usage:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
    $em-&amp;gt;flush();
} &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (DBALException $e) {
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($e-&amp;gt;getCode() === 23000) {
        echo &apos;&apos;;
    } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think I found where the problem is:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function driverExceptionDuringQuery(\Exception $driverEx, $sql, array $params = array())
{
    $msg = &lt;span class=&quot;code-quote&quot;&gt;&quot;An exception occurred &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; executing &apos;&quot;&lt;/span&gt;.$sql.&lt;span class=&quot;code-quote&quot;&gt;&quot;&apos;&quot;&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($params) {
        $msg .= &lt;span class=&quot;code-quote&quot;&gt;&quot; with params &quot;&lt;/span&gt;.json_encode($params);
    }
    $msg .= &lt;span class=&quot;code-quote&quot;&gt;&quot;:\n\n&quot;&lt;/span&gt;.$driverEx-&amp;gt;getMessage();

    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; self($msg, 0, $driverEx);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In &lt;tt&gt;return new self($msg, 0, $driverEx);&lt;/tt&gt;, the exception is created with an error code of 0.&lt;/p&gt;

&lt;p&gt;Is there a reason for this: is that that the driver exception may not always have a defined error code? (for example if the sql driver is not PDO or the SQL system doesn&apos;t support that, but in this case then the error code would be 0 would that be a problem?)&lt;/p&gt;</description>
                <environment></environment>
            <key id="14163">DBAL-371</key>
            <summary>DBALException doesn&apos;t forward the SQL exception code</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mnapoli">Matthieu Napoli</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Oct 2012 09:51:26 +0000</created>
                <updated>Thu, 9 May 2013 15:12:24 +0000</updated>
                    <resolved>Thu, 9 May 2013 15:12:24 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18877" author="mnapoli" created="Wed, 24 Oct 2012 11:14:46 +0000"  >&lt;p&gt;Pull request here: &lt;a href=&quot;https://github.com/doctrine/dbal/pull/221&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/221&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="20245" author="doctrinebot" created="Thu, 9 May 2013 15:12:06 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-221&amp;#93;&lt;/span&gt; was closed:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/221&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/221&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>