G
Guest
I want to do something like:
catch ( System.Data.OleDb.OleDbException err )
{
throw ( new System.Data.OleDb.OleDbException ( "something
application-specific" , err ) ) ;
}
But the constructoris not public (it seems).
Is there a work-around other than using System.Exception (which isn't
appropriate)?
I suppose deriving my own Exception is the best practice, so I'll do that,
but I don't think that the framework should enforce it. And I see now that
OleDbException is sealed, so I need to derive from
System.Data.Common.DbException which is, again, not quite what I want.
Perhaps if the goal is to help newbies find the best practice, the
constructor should be public but obsoleted and have the compiler display text
to point the newbie in the right direction.
catch ( System.Data.OleDb.OleDbException err )
{
throw ( new System.Data.OleDb.OleDbException ( "something
application-specific" , err ) ) ;
}
But the constructoris not public (it seems).
Is there a work-around other than using System.Exception (which isn't
appropriate)?
I suppose deriving my own Exception is the best practice, so I'll do that,
but I don't think that the framework should enforce it. And I see now that
OleDbException is sealed, so I need to derive from
System.Data.Common.DbException which is, again, not quite what I want.
Perhaps if the goal is to help newbies find the best practice, the
constructor should be public but obsoleted and have the compiler display text
to point the newbie in the right direction.