Previously the catch block treated all insert errors as "username already
exists". Now it checks the error message for UNIQUE/SQLITE_CONSTRAINT and
only returns the duplicate-username message for that case. Other errors
are logged and return a generic failure message.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replaced select-then-insert with direct insert wrapped in try-catch.
The UNIQUE constraint on username catches duplicate registrations
atomically, returning a clean error message instead of leaking
a raw DB exception.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>