nurpax / snaplet-sqlite-simple

sqlite-simple snaplet for the Snap Framework
Other
8 stars 5 forks source link

DuplicateLogin is not thrown for duplicate logins registered with registerUser #3

Closed nurpax closed 12 years ago

nurpax commented 12 years ago

According to Snap.Snaplet.Auth, createUser (called by registerUser) may throw a DuplicateLogin exception if the login already exists in the database. The same should also apply to registerUser (which calls createUser and doesn't catch exceptions).

This is not what's happening though. Instead, this is what we get:

A web handler threw an exception. Details:
user error (SQLite3 returned ErrorConstraint while attempting to perform finalize.)

This can be reproduced by registering the same user twice using the snap default project (but using the snaplet-sqlite-simple backend).

I think it's definitely worthwhile to handle duplicate logins. It's a common error case that needs to be handled in the web UI.

OTOH, it looks like the Json auth backend does handle duplicate logins.

nurpax commented 12 years ago

Will be fixed in snap-0.10 & latest snaplet-sqlite-simple