System.Data.SQLite Exception with wrong password

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

System.Data.SQLite Exception with wrong password

Marco Cosentino
Hi,
I'm using a password protected database.
When I type the wrong password in my app the resulting Exception is a
SQLiteException with  this message: "File opened is not a database file".
The ErrorCode is set to "NotADatabase".
Wouldn't it more correct if this code is set to something like
SQLiteErrorCode.Auth or the Exception is more specialized?

Thank you
Marco
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: System.Data.SQLite Exception with wrong password

Joe Mistachkin-3

Marco Cosentino wrote:
>
> The ErrorCode is set to "NotADatabase".
> Wouldn't it more correct if this code is set to something like
> SQLiteErrorCode.Auth or the Exception is more specialized?
>

The exceptions thrown by System.Data.SQLite reflect the underlying
error code returned from the native core SQLite library.  In the
case you mention, the exception is technically correct even though
it may seem counterintuitive at first glance.

--
Joe Mistachkin

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: System.Data.SQLite Exception with wrong password

Marco Cosentino
On 08/10/2011 01:24, Joe Mistachkin wrote:

> Marco Cosentino wrote:
>> The ErrorCode is set to "NotADatabase".
>> Wouldn't it more correct if this code is set to something like
>> SQLiteErrorCode.Auth or the Exception is more specialized?
>>
> The exceptions thrown by System.Data.SQLite reflect the underlying
> error code returned from the native core SQLite library.  In the
> case you mention, the exception is technically correct even though
> it may seem counterintuitive at first glance.
>
> --
> Joe Mistachkin
Hi Joe,
thank you for the reply.
I understand the point. But the encryption subsystem should be smart
enough to prevent passing an encrypted stream to the native SQLite
library (I am assuming that the encryption subsystem operates between
the SQLite core library and the OS).
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users