mirror of https://github.com/go-gorm/gorm.git
Fixed error message when dialector fails to initialize (#6509)
Let's say we have a problem with DSN which leads to dialector initialize error. However DB connection is not created and for some reason line 184 error provides <nil> even though "db" doesn't exist. Previously, this code leads to: panic: runtime error: invalid memory address or nil pointer dereference This fix now doesn't attempt to close non-existant database connection and instead continues, so the proper error is shown. In my case: [error] failed to initialize database, got error default addr for network 'localhost' unknown
This commit is contained in:
parent
7e44f73ad3
commit
ac07543962
Loading…
Reference in New Issue