strings.Contains(err.Error(), "UNIQUE") is used in internal/handlers/api.go and internal/handlers/auth.go to detect duplicate nick errors. Fragile if SQLite driver changes message format.
Suggested fix: Use errors.As with the SQLite driver's error type.
## From QA Audit ([#25 comment](https://git.eeqj.de/sneak/chat/issues/25#issuecomment-10914))
**Severity: SHOULD-FIX**
`strings.Contains(err.Error(), "UNIQUE")` is used in `internal/handlers/api.go` and `internal/handlers/auth.go` to detect duplicate nick errors. Fragile if SQLite driver changes message format.
**Suggested fix:** Use `errors.As` with the SQLite driver's error type.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
From QA Audit (#25 comment)
Severity: SHOULD-FIX
strings.Contains(err.Error(), "UNIQUE")is used ininternal/handlers/api.goandinternal/handlers/auth.goto detect duplicate nick errors. Fragile if SQLite driver changes message format.Suggested fix: Use
errors.Aswith the SQLite driver's error type.