mirror of
https://github.com/sigmasternchen/threadule
synced 2025-03-15 08:09:01 +00:00
better errors
This commit is contained in:
parent
21281b764d
commit
29333173dd
1 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,9 @@ import (
|
|||
)
|
||||
|
||||
func connect(dsn string) (*gorm.DB, error) {
|
||||
if strings.TrimSpace(dsn) == "" {
|
||||
return nil, errors.New("DSN is empty")
|
||||
}
|
||||
return gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue