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.
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:
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.