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>
Nuxt's bundler tree-shakes side-effect-only imports (import "./file").
Changed to export the handler from cleanup-logs.ts and call registerTask
explicitly in the plugin to ensure the task is registered at startup.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>