You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Sunitha Kambhampati <ks...@gmail.com> on 2006/03/10 22:55:17 UTC

Re: SQLException and missing stack trace

Hi all,

I came across this when I was fixing another issue and realized that the 
error message didnt show me the actual underlying exception/cause. 

cause is being lost in the following constructor in SqlException

    public SqlException(LogWriter logwriter,
        MessageId msgid, Object[] args, Throwable cause)
    {
        this(
            logwriter,
            msgutil_.getCompleteMessage(
                msgid.msgid,
                args),
            ExceptionUtil.getSQLStateFromIdentifier(msgid.msgid),
            ExceptionUtil.getSeverityFromIdentifier(msgid.msgid));
    }

maybe we should add setThrowable(cause) so we dont lose track of it.   

Thanks,
Sunitha.

Re: SQLException and missing stack trace

Posted by Sunitha Kambhampati <ks...@gmail.com>.
David W. Van Couvering wrote:

> Hi, Sunitha.  Did you log a JIRA for this?  I didn't see it...
>
I just did.  http://issues.apache.org/jira/browse/DERBY-1117

Thanks,
Sunitha.


Re: SQLException and missing stack trace

Posted by "David W. Van Couvering" <Da...@Sun.COM>.
Hi, Sunitha.  Did you log a JIRA for this?  I didn't see it...

David

David W. Van Couvering wrote:
> Yes, I agree this is a bug, thanks for catching this Sunitha.
> 
> David
> 
> Sunitha Kambhampati wrote:
> 
>> Hi all,
>>
>> I came across this when I was fixing another issue and realized that 
>> the error message didnt show me the actual underlying exception/cause.
>> cause is being lost in the following constructor in SqlException
>>
>>    public SqlException(LogWriter logwriter,
>>        MessageId msgid, Object[] args, Throwable cause)
>>    {
>>        this(
>>            logwriter,
>>            msgutil_.getCompleteMessage(
>>                msgid.msgid,
>>                args),
>>            ExceptionUtil.getSQLStateFromIdentifier(msgid.msgid),
>>            ExceptionUtil.getSeverityFromIdentifier(msgid.msgid));
>>    }
>>
>> maybe we should add setThrowable(cause) so we dont lose track of it.  
>> Thanks,
>> Sunitha.

Re: SQLException and missing stack trace

Posted by "David W. Van Couvering" <Da...@Sun.COM>.
Yes, I agree this is a bug, thanks for catching this Sunitha.

David

Sunitha Kambhampati wrote:
> Hi all,
> 
> I came across this when I was fixing another issue and realized that the 
> error message didnt show me the actual underlying exception/cause.
> cause is being lost in the following constructor in SqlException
> 
>    public SqlException(LogWriter logwriter,
>        MessageId msgid, Object[] args, Throwable cause)
>    {
>        this(
>            logwriter,
>            msgutil_.getCompleteMessage(
>                msgid.msgid,
>                args),
>            ExceptionUtil.getSQLStateFromIdentifier(msgid.msgid),
>            ExceptionUtil.getSeverityFromIdentifier(msgid.msgid));
>    }
> 
> maybe we should add setThrowable(cause) so we dont lose track of it.  
> Thanks,
> Sunitha.