Ensure error is logged on db reconnection attempts (#5780)
Ensure error is logged on db reconnection attempts (#5780)

Unfortunately a scoping problem was missed on the previous PR which meant that the only nil error was logged on failure to connect to the db. This pr fixes this.
lafriks/gitea,typeless/gitea,kubatyszko/gitea,lafriks/gitea,cez81/gitea,kubatyszko/gitea,vCaesar/gitea,vCaesar/gitea,lafriks/gitea,sapk-fork/gitea,cez81/gitea,go-gitea/gitea,go-gitea/gitea,cez81/gitea,typeless/gitea,vdbt/gitea,sapk-fork/gitea,sapk-fork/gitea,vdbt/gitea,kubatyszko/gitea,go-gitea/gitea,typeless/gitea,sapk-fork/gitea,typeless/gitea